Files
Bela/server
TMCandClaude Opus 5.5 6ecb844ae2
Release / build (push) Successful in 4m45s
Server: keep open rooms across restarts
A redeploy no longer ends the games in progress. The server writes the open
rooms (players, tokens, host, and each game as its seed and moves) to
$DATA_DIR/rooms.json every few seconds when something changed and once more
on shutdown (SIGTERM via Ktor's shutdown hook), and loads them before it
accepts connections. Clients reconnect with their saved token and get the
same table back; bots wait 30 s for them after a restart. Saves older than
10 minutes are ignored, and a game the new rules cannot replay leaves the
room in the lobby.

The image sets DATA_DIR=/data (owned by the bela user) and the compose file
mounts the bela-data named volume on it.

Also fixes a flaky test: the guest ignored its first table, so the game
waited forever whenever the random dealer made the guest call first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:32:26 +01:00
..