X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync.scm;h=05276a7987c186422a010d60f7ea6e9bfa9c4e85;hp=cdc03fd3d408f7dc1dc2e164adbba1e46b50fea2;hb=e18d4508d2aac16776030c9c25e599f6a7211cfc;hpb=ea3774311efdb27eaeff459aef3d91d28c8fe0ff diff --git a/mudsync.scm b/mudsync.scm index cdc03fd..05276a7 100644 --- a/mudsync.scm +++ b/mudsync.scm @@ -378,6 +378,10 @@ with an anonymous persona" ;;; And all of them need a GM! (define-class () + ;; location id + (loc #:init-value #f + #:accessor game-actor-loc) + ;; game master id (gm #:init-keyword #:gm #:getter game-actor-gm)) @@ -476,9 +480,6 @@ claim to point to." (define-class () (username #:init-keyword #:username #:accessor player-username) - ;; location id - (loc #:init-value #f - #:accessor player-loc) ;; Connection id (client #:accessor player-client) @@ -491,9 +492,9 @@ claim to point to." ;;; player message handlers (define-mhandler (player-set-loc! player message id) - (format #t "DEBUG: Location set to ~s for player ~s" + (format #t "DEBUG: Location set to ~s for player ~s\n" id (actor-id-actor player)) - (set! (player-loc player) id)) + (set! (game-actor-loc player) id)) (define-mhandler (player-init! player message) (player-look-around player)) @@ -503,11 +504,11 @@ claim to point to." (define (player-look-around player) (define room-name (message-ref - (<-wait player (player-loc player) 'get-name) + (<-wait player (game-actor-loc player) 'get-name) 'val)) (define room-desc (message-ref - (<-wait player (player-loc player) 'get-desc) + (<-wait player (game-actor-loc player) 'get-desc) 'val)) (define message-text (format #f "**~a**\n~a\n" room-name room-desc))