A table's options and its size are read one way, in spec.ts, by the server, the tally and the replay; a game may seat fewer for some options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
Eric Wagoner
2026-09-29 12:13:54 -04:00
co-authored by Claude Opus 5.5
parent faa2845e70
commit 6133a2469a
7 changed files with 64 additions and 23 deletions
+3 -3
View File
@@ -8,7 +8,7 @@
import { readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { game } from '../src/lib/game';
import type { SeatId } from '../src/lib/game/spec';
import { cleanOptions, type SeatId } from '../src/lib/game/spec';
interface Seat {
id: SeatId;
@@ -34,8 +34,8 @@ async function main(): Promise<void> {
const seats: Seat[] = [];
let state: ReturnType<typeof game.create> | null = null;
let turns = 0;
// The host's table options ride the room line; a game created without them is a different game.
const options = (lines[0]?.t === 'room' ? lines[0].options : undefined) as Record<string, string> | undefined;
// The host's table options ride the room line, read exactly as the server reads them.
const options = cleanOptions(game, lines[0]?.t === 'room' ? lines[0].options : undefined);
try {
for (const line of lines) {
if (line.t === 'seat') seats.push(line);