Skip to content

fix(games): Caption Clash host-start + Siege self-heal#2

Merged
bbjansen merged 1 commit into
mainfrom
fix/games-host-start-and-siege-reset
Jul 8, 2026
Merged

fix(games): Caption Clash host-start + Siege self-heal#2
bbjansen merged 1 commit into
mainfrom
fix/games-host-start-and-siege-reset

Conversation

@bbjansen

@bbjansen bbjansen commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Two showcase-breaking gameplay bugs, found by actually driving the games in a browser (WS-level checks had missed them — connection worked, gameplay didn't).

Caption Clash — host could never start a match. The server handler's isVip() used ctx.firstPlayer, but the platform passes an empty player list to handlers, so firstPlayer was always undefined → nobody was the VIP → the client showed "Start match" but the server silently rejected it. Fix: derive the VIP from state.players (first present by sorted id), matching the client's own gating. Also prune absent players while in the lobby so a persistent room stops accumulating ghost roster entries.

Siege — stuck on DEFEAT forever. The base takes damage even with no defenders and there was no reset, so a persistent room's base ended up destroyed and every new visitor saw an instant "base destroyed." Fix: reset to a fresh siege when the first player enters a room, and auto-restart a few seconds after any win/loss (keeping connected players, respawned at full health).

Test plan

  • 8 new handler tests (host/non-VIP/solo start, lobby ghost prune, first-join reset, auto-restart timing); full showcase suite 42 pass
  • Verified in production (handlers republished to WfP): 8/8 playability checks — both games start & play, and the polluted PARTY1/SIEGE1 default rooms self-healed

… stuck DEFEAT

Two showcase-breaking gameplay bugs found by driving the games in a
browser (WS-level checks had missed them):

Caption Clash — host could never start a match. The server handler's
isVip() used ctx.firstPlayer, but the platform passes an empty player
list to handlers, so firstPlayer was always undefined and nobody was the
VIP. Derive the VIP from state.players (first present by sorted id) to
match the client's own gating. Also prune absent players while in the
lobby so a persistent room stops accumulating ghost roster entries.

Siege — a persistent room stayed stuck on DEFEAT forever (the base takes
damage even with no defenders, and there was no reset), so every new
visitor saw an instant 'base destroyed'. Reset to a fresh siege when the
first player enters a room and auto-restart a few seconds after any
win/loss, keeping connected players respawned at full health.

Tests: 8 new handler tests (host/non-VIP/solo start, lobby ghost prune,
first-join reset, auto-restart timing). Full showcase suite 42 pass.
Verified in prod: 8/8 playability checks — both games start/play, and
the polluted PARTY1/SIEGE1 default rooms self-healed.
@bbjansen bbjansen merged commit 78f8c58 into main Jul 8, 2026
@bbjansen bbjansen deleted the fix/games-host-start-and-siege-reset branch July 8, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant