The host can give a stuck player's seat to the clockwork and make a phrase that brings a seat back, and a socket in a background tab no longer drops every minute

A "seats" button beside "transfer seat" opens the host's panel. In a game
under way, "give to the clockwork" lets an automaton play a person's seat
from the next beat, with their hand, treasures and place untouched; a
standIn line on the ledger records it, the chronicle says so, the
stand-in never talks under the person's name, and the person's token
opens nothing after. "Make a phrase" mints the four-word phrase for any
person's seat; claiming it re-seats on a new token, and a seat the
clockwork stood in for goes back to its person mid-turn. A rematch holds
a stood-in seat for its person. The gallery now has its own claim box,
for a player who opens the invite link in a fresh browser.

The client's watchdog pinged and then closed a socket quiet for 45
seconds. A background tab's timers run about once a minute, so the last
pong was always a minute old when it looked, and idle tabs reconnected
every 58 seconds. It now closes only when its own ping went unanswered.
The server pings every socket at the protocol level every 30 seconds and
drops one that left the last ping unanswered, so a crashed browser's
socket no longer lingers until TCP gives up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
This commit is contained in:
Eric WagonerandClaude Opus 5.5 committed 2026-10-16 15:43:24 -04:00
1 parent 7ef0c1bc14
commit 4b7e05713d
10 files changed
+476 -39

No files matched your search

+16 -3
View File
@@ -93,8 +93,9 @@ export interface KickLine {
at: string;
}
/** The keeper gave a person's seat a new token, for a player whose browser
* lost the old one; the old one opens nothing after. */
/** A person's seat got a new token, from the keeper or from a phrase the
* host made, and the old one opens nothing after. A seat the clockwork was
* standing in for goes back to a person. */
export interface ReseatLine {
kind: "reseat";
name: string;
@@ -102,13 +103,25 @@ export interface ReseatLine {
at: string;
}
/** The host gave a person's seat to the clockwork in a game under way: the
* wizard keeps their hand and place, the automaton plays their turns, and
* the person's token opens nothing until a reseat gives the seat back. */
export interface StandInLine {
kind: "standIn";
name: string;
by: string;
style: string;
tier: string;
at: string;
}
export interface AbandonLine {
kind: "abandon";
by: string;
at: string;
}
export type RoomLine = RoomMetaLine | JoinLine | StartLine | CommandLine | ChatLine | KickLine | ReseatLine | AbandonLine | RematchLine | ChallengeLine | GalleryTalkLine;
export type RoomLine = RoomMetaLine | JoinLine | StartLine | CommandLine | ChatLine | KickLine | ReseatLine | StandInLine | AbandonLine | RematchLine | ChallengeLine | GalleryTalkLine;
const DATA_DIR = process.env.WIZWAR_DATA_DIR ?? join(process.cwd(), "data", "rooms");