A room whose ledger cannot be read is logged and left unloaded, not the server down; the server has tests of its own

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:11 -04:00
co-authored by Claude Opus 5.5
parent 2810076677
commit faa2845e70
5 changed files with 69 additions and 6 deletions
+4 -1
View File
@@ -39,7 +39,10 @@ async function main(): Promise<void> {
try {
for (const line of lines) {
if (line.t === 'seat') seats.push(line);
else if (line.t === 'unseat') seats.splice(seats.findIndex((s) => s.id === line.id), 1);
else if (line.t === 'unseat') {
const i = seats.findIndex((s) => s.id === line.id);
if (i >= 0) seats.splice(i, 1);
}
else if (line.t === 'start') state = game.create(Object.fromEntries(seats.map((s) => [s.id, s.name])), line.seed, line.rules, options);
else if (line.t === 'turn' && state) {
state = game.resolve(state, line.inputs);