rely on stringification instead of state reports

This commit is contained in:
2025-01-17 23:04:38 +09:00
parent 80ccb92815
commit 9345c7af04
9 changed files with 123 additions and 73 deletions
+1 -1
View File
@@ -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', () => {