From 402c8489c040d664d6dccb919768d5d2ec310b97 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 8 Mar 2026 14:14:32 -0400 Subject: [PATCH] Use server as authoritative source of truth for tiles in the center Clients were trying to track the central state on their own and getting out of synch. Let's stick to "server as authoritative" as a principle. --- anagrams.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anagrams.js b/anagrams.js index 7847df7..f84437c 100644 --- a/anagrams.js +++ b/anagrams.js @@ -353,6 +353,10 @@ class Anagrams extends Game { reason }); + /* Broadcast authoritative state so clients resync. */ + this.broadcast_event_object("center", this.state.center); + this._broadcast_player_state(); + /* Activate next claimer if any. */ if (this.state.claim_queue.length > 0) { this._activate_claimer(); @@ -519,7 +523,8 @@ class Anagrams extends Game { reason: "accepted" }); - /* Broadcast full player words for state sync. */ + /* Broadcast authoritative state so clients resync. */ + this.broadcast_event_object("center", this.state.center); this._broadcast_player_state(); /* Activate next claimer if any. */ -- 2.45.2