refactor: include player positions in initial WebSocket state for enhanced tracking

This commit is contained in:
MayaTheShy
2026-02-20 04:29:28 -05:00
parent ddc1b03506
commit f61e7ca185

View File

@@ -368,7 +368,8 @@ wss.on('connection', (ws, req) => {
ws.send(JSON.stringify({
type: 'initial_state',
turtles: Array.from(turtles.values()).map(t => t.toJSON()),
blocks: blocks
blocks: blocks,
players: db.getAllPlayerPositions()
}));
ws.on('message', (message) => {