From cccb8136eb28268ab42770160cbffc263a896dfc Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 13 Jan 2024 13:23:32 +0100 Subject: Show multiplayer results by player name in game boxes. --- server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server.js b/server.js index 132c1cd..3dc7e52 100644 --- a/server.js +++ b/server.js @@ -1466,6 +1466,15 @@ function annotate_game_info(game, user_id, unread) { game.result = `${p.name} (${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 `${p.name}` + return role + }).join(", ") + } + if (game.status === STATUS_OPEN && game.is_ready && game.owner_id === user_id) game.your_turn = true -- cgit v1.2.3