summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-25 14:09:51 +0100
committerTor Andersson <tor@ccxvii.net>2023-03-01 21:17:48 +0100
commitdc069da5447f5856b59b5f1885f0eeb304abb670 (patch)
treecedd5ab69c31c0f13b98caef0b6414c12d0427ba
parentfab1401922290364fcd260d7390701b46aa3eb75 (diff)
downloadserver-dc069da5447f5856b59b5f1885f0eeb304abb670.tar.gz
Send presence as an array instead of an object!
-rw-r--r--server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.js b/server.js
index ecc03eb..3fad7d5 100644
--- a/server.js
+++ b/server.js
@@ -2222,9 +2222,10 @@ function on_restore(socket, state_text) {
}
function broadcast_presence(game_id) {
- let presence = {}
+ let presence = []
for (let socket of game_clients[game_id])
- presence[socket.role] = true
+ if (!presence.includes(socket.role))
+ presence.push(socket.role)
for (let socket of game_clients[game_id])
send_message(socket, 'presence', presence)
}