A refused seat is logged, and the wallet drops a seat only on the second refusal in a row

A lost seat mid-game is the costliest quiet failure this table has: one
refusal around a restart cost Kestrel PRPM's seat with nothing in the
journal to say why.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
Eric Wagoner
2026-09-17 23:22:00 -04:00
co-authored by Claude Fable 5.1
parent f738957100
commit 1ebd6dbe47
2 changed files with 15 additions and 2 deletions
+7 -1
View File
@@ -717,7 +717,12 @@ wss.on("connection", (socket, req) => {
const room = getRoom(roomId);
if (!room) return send(socket, { type: "error", message: "no such room" });
const result = joinRoom(room, name, typeof msg.token === "string" ? msg.token : null);
if ("error" in result) return send(socket, { type: "error", message: result.error });
if ("error" in result) {
// A refused seat is worth a line: a lost seat mid-game is the
// costliest quiet failure this table has.
console.warn(`join refused: room ${room.id} name ${JSON.stringify(name)}${result.error}`);
return send(socket, { type: "error", message: result.error });
}
leaveGallery(session);
session.playerId = name;
session.roomId = room.id;
@@ -1065,6 +1070,7 @@ wss.on("connection", (socket, req) => {
const result = peekSummary(roomId, name, typeof seat.token === "string" ? seat.token : null);
if (result === null) continue;
if (result === "badToken") {
console.warn(`seat voided: room ${roomId} name ${JSON.stringify(name)} — the token did not match`);
voided.push(`${roomId}:${name}`);
continue;
}