summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-09 17:20:25 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:06:33 +0100
commit9af6fc6e93d59e72da2d80eb63b3a9a9ce445fb8 (patch)
treee9c4a5a3f12233dc7c1f9de4fd9f5925dd3e2a8b /server.js
parent82a85c04cddc07f2375bba799a6ce3a5ba19a396 (diff)
downloadserver-9af6fc6e93d59e72da2d80eb63b3a9a9ce445fb8.tar.gz
Color invite-only games gold when all invites are accepted.
Diffstat (limited to 'server.js')
-rw-r--r--server.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.js b/server.js
index f389fbd..2910e36 100644
--- a/server.js
+++ b/server.js
@@ -1435,7 +1435,7 @@ function annotate_game_info(game, user_id, unread) {
if (p.user_id === user_id) {
your_role = p.role
your_count++
- if ((p_is_active || p_is_owner) && game.is_ready)
+ if (p_is_active && game.is_ready)
game.your_turn = true
if (p.is_invite)
game.your_turn = true
@@ -1460,6 +1460,9 @@ function annotate_game_info(game, user_id, unread) {
game.result = `${link} (${game.result})`
}
+ if (game.status === STATUS_OPEN && game.is_ready && game.owner_id === user_id)
+ game.your_turn = true
+
if (your_count > 0) {
game.is_yours = true
if (your_count === 1)