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>
- shared: the whole UI moves to Compose Multiplatform (Android + Kotlin/Wasm). Platform pieces
(card images, storage, links, back button) come in through a Platform interface; fonts, logo and
suit icons are compose resources; images are reduced by halving so they stay sharp everywhere.
- web: the browser app (bela.mariosem.es), with 1x card faces, localStorage and room links (?soba=KOD).
- Online play: lobby (name, open a room, join by code), waiting room with seats, then the usual
table. The server runs every game with the engine and sends each player only their own view;
bots fill empty seats; same pacing as the local game. Reconnect with a saved token (also after
closing the app or reloading the page), 10 s grace before a bot plays for an absent player,
heartbeat so dead connections are noticed.
- server: Ktor (WebSocket /ws, /health, serves the web app with pre-compressed files). Tests cover
a whole two-player game, resume and leaving.
- Dockerfile (one image: web + server, tests run in the build), docker-compose.yml and a Gitea
Actions workflow like Keep's (build, Trivy scan, push msemes/bela:<sha> and :latest).
- Android talks to the server with Ktor CIO; the update section stays Android-only. The QR code is
precomputed (QrMatrix) and checked against ZXing in a unit test.
- -PbelaNoAndroid=true builds without the Android SDK; -PbelaDownloadNode=false reuses the local Node.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>