diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-01-13 13:23:32 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-28 13:50:27 +0100 |
commit | cccb8136eb28268ab42770160cbffc263a896dfc (patch) | |
tree | f0672f46429ae69beb36af21768acfa4f13cf885 | |
parent | 143d3920f68a01ad062865a65438923e68322a1b (diff) | |
download | server-cccb8136eb28268ab42770160cbffc263a896dfc.tar.gz |
Show multiplayer results by player name in game boxes.
-rw-r--r-- | server.js | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1466,6 +1466,15 @@ function annotate_game_info(game, user_id, unread) { game.result = `<a href="/user/${p.name}">${p.name}</a> (${game.result})` } + if (game.result && game.result.includes(",")) { + game.result = game.result.split(", ").map(role => { + for (let p of game.players) + if (p.role === role) + return `<a href="/user/${p.name}">${p.name}</a>` + return role + }).join(", ") + } + if (game.status === STATUS_OPEN && game.is_ready && game.owner_id === user_id) game.your_turn = true |