X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Frun-game.scm;h=17bce5dadb2c8f52f7d8cc42ef3b6fa3be6d360d;hp=c9d1f423a31262e6004480c7ea5c91c1480d289d;hb=refs%2Fheads%2F8sync-fibers;hpb=0327c09557568d1fefd7d642333c21c8a9f655db diff --git a/mudsync/run-game.scm b/mudsync/run-game.scm index c9d1f42..17bce5d 100644 --- a/mudsync/run-game.scm +++ b/mudsync/run-game.scm @@ -20,7 +20,8 @@ #:use-module (mudsync game-master) #:use-module (8sync) #:use-module (8sync repl) - #:use-module (8sync debug) + #:use-module (fibers conditions) + ;; #:use-module (8sync debug) #:use-module (srfi srfi-1) #:use-module (ice-9 receive) #:use-module (ice-9 q) @@ -78,25 +79,33 @@ ;;; ================== (define* (run-demo game-spec default-room #:key repl-server) - (define hive (make-hive)) - (define new-conn-handler - (make-default-room-conn-handler default-room)) - (define gm - (bootstrap-actor-gimmie* hive "gm" - #:new-conn-handler new-conn-handler)) - (define injector - (bootstrap-actor hive - #:gm (actor-id gm))) + (run-hive + (lambda (hive) + (define new-conn-handler + (make-default-room-conn-handler default-room)) + (define gm + ;; (bootstrap-actor-gimmie* hive "gm" + ;; #:new-conn-handler new-conn-handler) + (create-actor* "gm" + #:new-conn-handler new-conn-handler)) + (define injector + (create-actor + #:gm gm)) - (define repl-manager - (bootstrap-actor* hive "repl" + (define repl-manager + (create-actor* "repl" #:subscribers (list injector))) - (set! %live-gm gm) - (set! %live-hive hive) + ;; (set! %live-gm gm) + (set! %live-hive hive) - (set! %inject-queue (make-q)) + (set! %inject-queue (make-q)) - (run-hive hive - (list (bootstrap-message hive (actor-id gm) 'init-world - #:game-spec game-spec)))) + (<- gm 'init-world + #:game-spec game-spec) + ;; (run-hive hive + ;; (list (bootstrap-message hive (actor-id gm) 'init-world + ;; #:game-spec game-spec))) + (wait (make-condition))) + ;; Just for testing / for now... + #:parallelism 1))