rely on stringification instead of state reports
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ app.use(express.urlencoded({ extended: true }))
|
||||
app.ws('/ws', async (req, res) => {
|
||||
const websocket = await res.accept()
|
||||
|
||||
const subscription = () => websocket.send(JSON.stringify(game.state()))
|
||||
const subscription = () => websocket.send(JSON.stringify(game))
|
||||
game.eventEmitter.on('tick', subscription)
|
||||
|
||||
websocket.on('close', () => {
|
||||
|
||||
Reference in New Issue
Block a user