projects
/
mudsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update codebase to use 8sync-fibers
[mudsync.git]
/
mudsync
/
player.scm
diff --git
a/mudsync/player.scm
b/mudsync/player.scm
index f04c2feea3e6870326d4b2e5b32da951e7e19b04..feea1ef5bbbf5454c8a1cd2deb05b7995e6cc728 100644
(file)
--- 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 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)
#:use-module (8sync actors)
#:use-module (8sync agenda)
#:use-module (8sync rmeta-slot)
@@
-100,7
+101,7
@@
(define inv-names
(map
(lambda (inv-item)
(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 '())
(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
#:player-id (actor-id player)))))
;; Ask the room for its commands
- (define room-commands
+ (define room-
dom-
commands
;; TODO: Map room id and sort
;; 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))
#:verb verb)
commands))
@@
-159,7
+167,7
@@
(define co-occupants
(remove
(lambda (x) (equal? x (actor-id player)))
(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...
;; @@: 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)
(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
(<-wait co-occupant 'get-commands
#:verb verb)
(append
@@
-192,7
+200,7
@@
(define inv-item-commands
(fold
(lambda (inv-item prev)
(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
(<-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
;; 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
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
(define (sort-commands-append-actor commands actor-id goes-by)
(sort-commands-multi-actors