#:getter gm-reverse-client-dir)
;; Network manager
- (network-manager #:accessor gm-network-manager
+ (network-manager #:getter gm-network-manager
#:init-value #f)
;; How we get a new connection acclimated to the system
- (new-conn-handler #:accessor gm-new-conn-handler
+ (new-conn-handler #:getter gm-new-conn-handler
#:init-keyword #:new-conn-handler)
(message-handler
(define (gm-setup-network gm)
;; Create a default network manager if none available
- (set! (gm-network-manager gm)
- (create-actor* gm <network-manager> "netman"
+ (slot-set! gm 'network-manager
+ (create-actor* gm <network-manager> "netman"
#:send-input-to (actor-id gm)))
;; TODO: Add host and port options
(define-class <gameobj> (<actor>)
;; location id
(loc #:init-value #f
- #:accessor gameobj-loc)
+ #:getter gameobj-loc)
;; Uses a hash table like a set (values ignored)
(occupants #:init-thunk make-hash-table
- #:accessor gameobj-occupants)
+ #:getter gameobj-occupants)
;; game master id
(gm #:init-keyword #:gm
(format #t "DEBUG: Location set to ~s for ~s\n"
loc (actor-id-actor actor))
- (set! (gameobj-loc actor) loc)
+ (slot-set! actor 'loc loc)
;; Change registation of where we currently are
(if loc
(<-wait actor loc 'add-occupant! #:who (actor-id actor)))
(define %default-port 8889)
(define-class <network-manager> (<actor>)
- (server-socket #:accessor nm-server-socket)
+ (server-socket #:getter nm-server-socket)
;; mapping of client -> client-id
- (clients #:accessor nm-clients
+ (clients #:getter nm-clients
#:init-thunk make-hash-table)
;; send input to this actor
(send-input-to #:getter nm-send-input-to
;; (sigaction SIGPIPE SIG_IGN)
;; Will this break other things that use pipes for us though?
- (set! (nm-server-socket nm) s)
+ (slot-set! nm 'server-socket s)
(format #t "Listening for clients in pid: ~s\n" (getpid))
(8sync-port s #:read (lambda (s) (nm-new-client nm s)))
(define-class <player> (<gameobj>)
(username #:init-keyword #:username
- #:accessor player-username)
- ;; Connection id
- (client #:accessor player-client)
+ #:getter player-username)
(self-commands
#:init-value '()
- #:accessor player-self-commands)
+ #:getter player-self-commands)
(message-handler
#:init-value