refactor: include player positions in initial WebSocket state for enhanced tracking
This commit is contained in:
@@ -368,7 +368,8 @@ wss.on('connection', (ws, req) => {
|
|||||||
ws.send(JSON.stringify({
|
ws.send(JSON.stringify({
|
||||||
type: 'initial_state',
|
type: 'initial_state',
|
||||||
turtles: Array.from(turtles.values()).map(t => t.toJSON()),
|
turtles: Array.from(turtles.values()).map(t => t.toJSON()),
|
||||||
blocks: blocks
|
blocks: blocks,
|
||||||
|
players: db.getAllPlayerPositions()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
ws.on('message', (message) => {
|
ws.on('message', (message) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user