X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=mudsync%2Fplayer.scm;h=feea1ef5bbbf5454c8a1cd2deb05b7995e6cc728;hb=refs%2Fheads%2F8sync-fibers;hp=f04c2feea3e6870326d4b2e5b32da951e7e19b04;hpb=f077644528d3ff0aa8b64c3050f72e9b08b80d49;p=mudsync.git diff --git a/mudsync/player.scm b/mudsync/player.scm index f04c2fe..feea1ef 100644 --- a/mudsync/player.scm +++ b/mudsync/player.scm @@ -21,6 +21,7 @@ #:use-module (mudsync gameobj) #:use-module (mudsync game-master) #:use-module (mudsync parser) + #:use-module (mudsync receive-star) #:use-module (8sync actors) #:use-module (8sync agenda) #:use-module (8sync rmeta-slot) @@ -100,7 +101,7 @@ (define inv-names (map (lambda (inv-item) - (mbody-val (<-wait inv-item 'get-name))) + (<-wait inv-item 'get-name)) (gameobj-occupants player))) (define text-to-show (if (eq? inv-names '()) @@ -148,10 +149,17 @@ #:player-id (actor-id player))))) ;; Ask the room for its commands - (define room-commands + (define room-dom-commands ;; TODO: Map room id and sort - (mbody-receive (_ #:key commands) - (<-wait player-loc 'get-container-commands + (receive* (#:key commands) + (<-wait player-loc 'get-container-dom-commands + #:verb verb) + commands)) + + (define room-sub-commands + ;; TODO: Map room id and sort + (receive* (#:key commands) + (<-wait player-loc 'get-container-sub-commands #:verb verb) commands)) @@ -159,7 +167,7 @@ (define co-occupants (remove (lambda (x) (equal? x (actor-id player))) - (mbody-val (<-wait player-loc 'get-occupants)))) + (<-wait player-loc 'get-occupants))) ;; @@: There's a race condition here if someone leaves the room ;; during this, heh... @@ -170,7 +178,7 @@ (define co-occupant-commands (fold (lambda (co-occupant prev) - (mbody-receive (_ #:key commands goes-by) + (receive* (#:key commands goes-by) (<-wait co-occupant 'get-commands #:verb verb) (append @@ -192,7 +200,7 @@ (define inv-item-commands (fold (lambda (inv-item prev) - (mbody-receive (_ #:key commands goes-by) + (receive* (#:key commands goes-by) (<-wait inv-item 'get-contained-commands #:verb verb) (append @@ -205,12 +213,14 @@ ;; Now return a big ol sorted list of ((actor-id . command)) (append - (sort-commands-append-actor room-commands + (sort-commands-append-actor room-dom-commands player-loc '()) ; room doesn't go by anything (sort-commands-multi-actors co-occupant-commands) (sort-commands-append-actor our-commands (actor-id player) '()) ; nor does player - (sort-commands-multi-actors inv-item-commands))) + (sort-commands-multi-actors inv-item-commands) + (sort-commands-append-actor room-sub-commands + player-loc '()))) (define (sort-commands-append-actor commands actor-id goes-by) (sort-commands-multi-actors