(when (and socket (si::listen socket)) (push (si:accept socket) clients)))
(defun eval-from-clients ()
- (dolist (cli clients) (when (si::listen cli) (eval (read cli))))))
+ (dolist (cli clients) (when (si::listen cli) (eval (read cli)))))
+ (defun stop-server ()
+ (when socket
+ (dolist (cli clients) (si::close cli))
+ (si::close socket)
+ (setq socket nil clients nil))))
-;;; GaCeLa Functions
-(let (commands)
- (defun prog-command (command)
- (setq commands (cons command commands)))
-
- (defun run-commands ()
- (cond (commands
- (let (running)
- (setq running commands)
- (setq commands nil)
- (labels ((run-com (comlst)
- (cond (comlst (run-com (cdr comlst))
- (eval (read-from-string (concatenate 'string "(progn " (car comlst) ")")))))))
- (run-com running)))))))
+;;; GaCeLa Functions
(let (time (time-per-frame (/ 1000.0 *frames-per-second*)))
(defun set-frames-per-second (fps)
(setq time-per-frame (/ 1000.0 fps)))
(do ((mob (pop mobs-to-add) (pop mobs-to-add))) ((null mob))
(push mob running-mobs)
(funcall (symbol-function mob) :init))
- (setq running-mobs (reverse (set-difference running-mobs mobs-to-quit))))
+ (setq running-mobs (reverse (set-difference running-mobs mobs-to-quit)))
+ (setq mobs-to-quit nil))
(defun quit-all-mobs ()
(setq running-mobs nil mobs-to-add nil mobs-to-quit nil)))