summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-03 23:10:46 +0200
committerTor Andersson <tor@ccxvii.net>2023-04-18 10:06:13 +0200
commit58d8b4e1fec0692bbc78db73c54385f5efbe3e8f (patch)
tree1649dd6dca575775ec76ff6c2915c26b6207b506 /server.js
parent8f95aa8d593c284a153a20e01ef3050343118c05 (diff)
downloadserver-58d8b4e1fec0692bbc78db73c54385f5efbe3e8f.tar.gz
Only send required information in "players" message.
Diffstat (limited to 'server.js')
-rw-r--r--server.js2
1 files changed, 1 insertions, 1 deletions
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)