Split The code is public; the app answers only to the crew.
Death and the end of the match read right: spectate the player you are watching, and show the result #11
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Finish the two ends of a match — dying and winning — so the game stops leaving you looking at a HUD that belongs to someone else and a menu that never says who won.
Two concrete holes in
src/client/main.tsandsrc/client/hud.ts:spectated()moves the camera to a living teammate when you die, butdrawHudis handedworldand always readsworld.me. So you watch a teammate's view while the HUD shows your zero health, your empty magazine and a crosshair for a corpse. It also never says who killed you.world.match.phasebecomesmatch_over, the loop stops and callsshow(menu, true). The menu still reads "Defuse or detonate": the final score, whether you won, and what you did are nowhere on the screen.postResult(true)refreshes the leaderboard section far below the fold, and that is the only trace.Done looks like
drawHudtakes the player it is drawing rather than reaching forworld.me, and shows that player's health, armour, ammo and weapon.messagesline is enough if it survives long enough to read.match_overan overlay says who won, the final score, and your kills, deaths, headshots and damage, with a button that starts another match and a button back to the menu. It is DOM like the other overlays, keyboard-reachable, 44px controls, and it does not shift the page.postResult(true)has been sent, and a failed post does not stop it appearing.bun testcovers what is headless: the summary's numbers come from a pure function overWorld(who won, the score from the player's side, the player's line) and it is tested; the server already refuses impossible numbers, so nothing changes there.bun run scripts/build.tsrun and the rebuilt bundle committed.Files I expect to change
src/client/hud.ts,src/client/main.ts,src/pages/game.ts(the new overlay's markup and its styles),src/client/match.tsor a small new module for the summary, its test,static/app.<hash>.js.Risks
The HUD signature change touches every call site — there is only one, but the hit markers and the damage indicator are drawn for the player being watched, and a spectator must not see the dead player's old markers. The summary overlay must not steal pointer lock back while the match is over.
Who
The same builder as the damage-indicator issue, after it: both rewrite
drawHud's reading of the player, and doing them in the other order means a conflict.