From 16923601694569ec6dea85c6642b554515fa5c59 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 8 Mar 2026 19:13:53 -0400 Subject: [PATCH] anagrams: Restart any necessary timers when restoring a game This could give some extra time to the current in-progress claim/vote, but that's fine, (and better than leaving the timer un-started which could result in a hung game if a player has been disconnected). --- anagrams.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/anagrams.js b/anagrams.js index c0e3be8..1ec3cb4 100644 --- a/anagrams.js +++ b/anagrams.js @@ -853,6 +853,13 @@ class Anagrams extends Game { restore(data) { super.restore(data); this.state.done_players = new Set(this.state.done_players); + + /* Restart timers that were active at save time. */ + if (this.state.vote_pending) { + this._vote_timer = setTimeout(() => this._resolve_vote(), VOTE_TIMEOUT_MS); + } else if (this.state.claim_queue.length > 0) { + this._activate_claimer(); + } } } -- 2.45.2