Split mudsync.scm out into multiple files
[mudsync.git] / mudsync / run-game.scm
diff --git a/mudsync/run-game.scm b/mudsync/run-game.scm
new file mode 100644 (file)
index 0000000..286ff7d
--- /dev/null
@@ -0,0 +1,45 @@
+;;; Mudsync --- Live hackable MUD
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;;
+;;; This file is part of Mudsync.
+;;;
+;;; Mudsync is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; Mudsync is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Mudsync.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (mudsync run-game)
+  #:use-module (mudsync game-master)
+  #:use-module (8sync systems actors)
+  #:use-module (8sync systems actors debug)
+  #:export (run-demo
+            ;; Just temporarily
+            %test-gm))
+
+
+;;; Debugging stuff
+;;; ===============
+
+(define %test-gm #f)
+
+(define (run-demo db-path room-spec default-room)
+  (define hive (make-hive))
+  (define new-conn-handler
+    (make-default-room-conn-handler default-room))
+  (define gm
+    (hive-create-actor-gimmie* hive <game-master> "gm"
+                               #:new-conn-handler new-conn-handler))
+  (set! %test-gm gm)
+  ;; @@: Boy, wouldn't it be nice if the agenda could do things
+  ;;   on interrupt :P
+  (ez-run-hive hive
+               (list (bootstrap-message hive (actor-id gm) 'init-world
+                                        #:room-spec room-spec))))