summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
}