From 58d8b4e1fec0692bbc78db73c54385f5efbe3e8f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 3 Apr 2023 23:10:46 +0200 Subject: Only send required information in "players" message. --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server.js') diff --git a/server.js b/server.js index 962d277..d3dfe80 100644 --- a/server.js +++ b/server.js @@ -2368,7 +2368,7 @@ wss.on('connection', (socket, req, client) => { } if (socket.seen === 0) - send_message(socket, 'players', [socket.role, players]) + send_message(socket, 'players', [socket.role, players.map(p => ({ name: p.name, role: p.role }))]) if (game_clients[socket.game_id]) game_clients[socket.game_id].push(socket) -- cgit v1.2.3