From: Christopher Allan Webber Date: Sat, 30 Apr 2016 22:34:54 +0000 (-0500) Subject: Move location onto game-actor X-Git-Tag: fosdem-2017~206 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e18d4508d2aac16776030c9c25e599f6a7211cfc;p=mudsync.git Move location onto game-actor --- 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))