Split The code is public; the app answers only to the crew.
A match you walk out of stops calling itself "in progress" on the leaderboard #50
commented
Since this was written, #48 landed GET /api/leaderboard (leaderboardJson in src/pages/game.ts), which hands finished straight out as data. So the third state has to be right in three renderers, not two: the HTML list, the JSON, and src/tty.ts. The rule for a stale row still belongs in one place that all three read.
Sign in to join this conversation.
Leave a match from the pause overlay and its row sits on the front page as
· in progressforever.toMenu()insrc/client/main.tssetsrunning = false, drops the world and posts nothing, so the last thing the server heard was a mid-match update withfinished: false;recentMatchesrenders every such row as in progress with no time bound, andsrc/tty.tsshows the same row as(live). The standings count its matches and its partial kills, so the page's Recent matches list slowly fills with games nobody is playing.Done looks like:
src/result.tslike every other field, defaulting to the behaviour we have today when a client does not send it.abandonedfor those rows instead ofin progress, andsrc/tty.tssays the same word in its match list. Standings keep the kills and the match, and still count no win — a win already requiresfinished = 1.result.tsparses the new state and rejects a bad one;db.tsround-trips it;statsHtmlshowsabandonedfor a left match andin progressfor one updated seconds ago; standings are unchanged by an abandoned match's win column; and the terminal's match list renders the same word.bun testgreen, README says what the three states mean.Not in this issue: resuming an abandoned match, deleting rows (that is #40), and any change to how often a live match posts.
Files I expect to change:
src/result.ts,src/db.ts,src/pages/game.ts,src/tty.ts,src/client/main.ts, the tests beside each,README.md.Risks: this is the
/api/matchboundary, which #34 is rewriting to tie a result to a forge identity — hence the dependency; land on top of whatever shape that leaves rather than beside it. A schema change needsCREATE TABLE IF NOT EXISTSto stay true for a database that already has rows: add the column with a default and do not drop anything.#41is movingserve(); keep out ofsrc/server.tsif you can.Who: scout — server, page and terminal.