Remove with-vat so we can use make-joiner

This commit is contained in:
Vivianne 2023-07-06 22:04:51 -07:00
parent 2148ae2e8d
commit 3bb0c69096

View file

@ -46,18 +46,11 @@
;; Joiner logic
;;
(define (make-joiner ^game-controller addr)
(with-vat (spawn-vat)
(define mycapn (spawn-mycapn (new-onion-netlayer)))
(define init-sref (string->ocapn-id addr))
(define initiator ($ mycapn 'enliven init-sref))
(define joiner (spawn ^game-joiner initiator ^game-controller))
(<- initiator 'register-opponent joiner ($ joiner 'get-sealed-pick))))
;; temp for repl stuff
(define (resolve-initiator addr)
(define mycapn (spawn-mycapn (new-onion-netlayer)))
(define init-sref (string->ocapn-id addr))
($ mycapn 'enliven init-sref))
(define initiator ($ mycapn 'enliven init-sref))
(define joiner (spawn ^game-joiner initiator ^game-controller))
(<- initiator 'register-opponent joiner ($ joiner 'get-sealed-pick)))
(define (^game-joiner bcom initiator ^game-controller)
(define-values (seal-pick unseal-pick my-pick?)