]> git.cworth.org Git - lmno-server/blobdiff - empathy.js
Remove player names from answering and judging when they submit
[lmno-server] / empathy.js
index ae400a6009709deceef876caa71343a1957a4d1a..abaf72f247fc5f796a79e49df594e4702124e6c5 100644 (file)
@@ -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 };