From: Carl Worth Date: Sun, 14 Jun 2020 21:57:10 +0000 (-0700) Subject: Remove player names from answering and judging when they submit X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=commitdiff_plain;h=7a74c7c98826465f1cc0524f2717417df35a5097;hp=c748592a7db27adebd48b45970b5f0ffbedb3300 Remove player names from answering and judging when they submit Without this fix, reloading the "still waiting" view would make player names that had previously submitted erroneously appear in the "still waiting" list once again. --- diff --git a/empathy.js b/empathy.js index ae400a6..abaf72f 100644 --- a/empathy.js +++ b/empathy.js @@ -135,8 +135,11 @@ class Empathy extends Game { answers: answers }); - /* And notify all players that this player has answered. */ + /* Update state (to be sent out to any future clients) */ + this.state.players_answering.delete(player.name); this.state.players_answered.push(player.name); + + /* And notify all players that this player has answered. */ this.broadcast_event_object('player-answered', player.name); return { valid: true }; @@ -244,8 +247,11 @@ class Empathy extends Game { } } - /* And notify all players this this player has judged. */ + /* Update state (to be sent out to any future clients) */ + this.state.players_judging.delete(player.name); this.state.players_judged.push(player.name); + + /* And notify all players this this player has judged. */ this.broadcast_event_object('player-judged', player.name); return { valid: true };