]> git.cworth.org Git - lmno-server/commitdiff
anagrams: Send words/letters being claimed
authorCarl Worth <cworth@cworth.org>
Sun, 8 Mar 2026 15:58:13 +0000 (11:58 -0400)
committerCarl Worth <cworth@cworth.org>
Sun, 8 Mar 2026 15:58:13 +0000 (11:58 -0400)
So that clients can display an in-progress claim to make it clear
what's happening.

anagrams.js

index ddfe846fba3de9cc5b539afaec7dfe87aab12394..7847df7645e4591b9964316473f4ff922a9dd999 100644 (file)
@@ -749,13 +749,18 @@ class Anagrams extends Game {
       remaining: this.state.bag.length
     })}\n\n`);
 
-    /* Send active claim state if any. */
+    /* Send active claim state if any, including items already claimed. */
     if (this.state.claim_queue.length > 0) {
       const claimer = this.active_claimer_player();
       response.write(`event: claim-start\ndata: ${JSON.stringify({
         player_name: claimer ? claimer.name : "Unknown",
         timeout_ms: 0,
-        warning_ms: 0
+        warning_ms: 0,
+        claimed_letters: this.state.claimed_letters,
+        claimed_words: this.state.claimed_words.map(cw => ({
+          word: cw.word_obj.word,
+          word_id: cw.word_id
+        }))
       })}\n\n`);
     }