The tally: a booklet tab counting the love

A new tab in the help booklet answers "how much is this getting
played?" from the ledgers themselves: games chronicled (begun and
fought to a finish), distinct wizards seated, every spell, step, and
punch recorded, time at the table estimated by the clock between
moves (gaps over ten minutes don't count — async games tell the
truth), victories split by treasure-theft versus last standing, the
longest game, the fullest table, and the date the first game was
dealt. Computed server-side over the in-memory rooms with a 60-second
cache, fetched over the socket when the tab opens.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-16 11:31:14 -04:00
co-authored by Claude Fable 5
parent ced4dc5749
commit 85831828d7
5 changed files with 114 additions and 4 deletions
+5
View File
@@ -20,6 +20,7 @@ import {
catchUpSteps,
claimTransferCode,
createRoom,
engagementStats,
pickColor,
getRoom,
joinRoom,
@@ -296,6 +297,10 @@ wss.on("connection", (socket) => {
broadcastRoomState(room);
break;
}
case "stats": {
send(socket, { type: "stats", stats: engagementStats() });
break;
}
case "myGames": {
// {seats: [{roomId, name, token}]} -> summaries for valid seats.
const seats = Array.isArray(msg.seats) ? msg.seats.slice(0, MAX_MYGAMES_SEATS) : [];