Players aren't shown their own best round when they connect #9

Open
opened 2026-10-12 11:09:04 -04:00 by goddard · 1 comment
Collaborator

When a player connects, the welcome shows the map record and who holds it, but not the player's own best on that map. Regulars mostly stick to one map, so their own best is the target most likely to bring them back, and Electric Cherry already has it.

  • lb_show_hud (tws_t5_leaderboard.gsc:140-160, the same on T6) shows "Record: Round N" and up to three "Held by" rows. .leaders replays the same display (:104).
  • The public leaderboard API already returns one player's rank and best round for a map. GET /api/leaderboard?game=t5&metric=highestRound&map=t5:zombie_cod5_factory&q=<guid> returned D4rk_sH4d0wZ with rank 58, highest round 18 and 19 completed games. rank is the player's rank on the map before the search filter is applied (docs/guides/leaderboard.md, "Success response").
  • q matches a substring of the name or GUID (leaderboard.md:258), so the script has to pick the entry whose guid equals the player's.
  • Regulars are loyal to one map. D4rk_sH4d0wZ played all 25 of their completed matches on Der Riese, memphis77 all 14 on Kino and cfzred all 10 on Kino.

Fix

  • On connect, T5 and T6 show the player's own best on this map below the record, for example "Your best here: round 18 (rank 58)", or "No recorded round here yet" for a player without one.
  • The lookup uses the public leaderboard API with the player's GUID and the current map, and uses only the entry whose guid matches exactly.
  • The request runs in the level worker like the record lookup (tws_t5_leaderboard.gsc:309), and a failed or slow lookup drops the personal line without delaying or hiding the record.
  • .leaders shows the personal line too.
  • The live checks cover a player with a recorded best, a player without one, and Electric Cherry being unreachable.
When a player connects, the welcome shows the map record and who holds it, but not the player's own best on that map. Regulars mostly stick to one map, so their own best is the target most likely to bring them back, and Electric Cherry already has it. - `lb_show_hud` (`tws_t5_leaderboard.gsc:140-160`, the same on T6) shows "Record: Round N" and up to three "Held by" rows. `.leaders` replays the same display (`:104`). - The public leaderboard API already returns one player's rank and best round for a map. `GET /api/leaderboard?game=t5&metric=highestRound&map=t5:zombie_cod5_factory&q=<guid>` returned D4rk_sH4d0wZ with rank 58, highest round 18 and 19 completed games. `rank` is the player's rank on the map before the search filter is applied (`docs/guides/leaderboard.md`, "Success response"). - `q` matches a substring of the name or GUID (`leaderboard.md:258`), so the script has to pick the entry whose `guid` equals the player's. - Regulars are loyal to one map. D4rk_sH4d0wZ played all 25 of their completed matches on Der Riese, memphis77 all 14 on Kino and cfzred all 10 on Kino. **Fix** - [ ] On connect, T5 and T6 show the player's own best on this map below the record, for example "Your best here: round 18 (rank 58)", or "No recorded round here yet" for a player without one. - [ ] The lookup uses the public leaderboard API with the player's GUID and the current map, and uses only the entry whose `guid` matches exactly. - [ ] The request runs in the level worker like the record lookup (`tws_t5_leaderboard.gsc:309`), and a failed or slow lookup drops the personal line without delaying or hiding the record. - [ ] `.leaders` shows the personal line too. - [ ] The live checks cover a player with a recorded best, a player without one, and Electric Cherry being unreachable.
goddard added the
priority
low
type/featuregame/t5game/t6
labels 2026-10-12 11:09:04 -04:00
josh was assigned by goddard 2026-10-12 11:09:04 -04:00
Author
Collaborator

Reviewed 3bb0b5178e. Unresolved; leaving open.

This review checks the current implementation against every acceptance criterion, regardless of commit references.

Checklist

  • Personal-best display. Both lb_show_hud functions display only the map record and Held by rows.
  • Exact player lookup. The HTTP worker fetches the global map leaderboard; there is no per-player GUID query plus exact GUID selection for a personal-best result.
  • Independent worker/failure behavior. No personal lookup is scheduled, so its timeout/failure isolation is not implemented.
  • .leaders personal line. Both .leaders handlers replay the same global snapshot without a personal result.
  • Live checks. No personal-best/no-record/backend-unreachable acceptance matrix is documented for the proposed feature.

Review notes

  • node tools/check_leaderboard.mjs: 137 existing fixture/static checks passed for both games. These validate the global record implementation, not this absent feature.

Next steps

  • Implement the per-player lookup and optional personal row without delaying the global record; cover both welcome and .leaders and document the three live scenarios.
Reviewed 3bb0b5178e40ea6d322093283edb39f160542a07. Unresolved; leaving open. This review checks the current implementation against every acceptance criterion, regardless of commit references. **Checklist** - [ ] **Personal-best display.** Both lb_show_hud functions display only the map record and Held by rows. - [ ] **Exact player lookup.** The HTTP worker fetches the global map leaderboard; there is no per-player GUID query plus exact GUID selection for a personal-best result. - [ ] **Independent worker/failure behavior.** No personal lookup is scheduled, so its timeout/failure isolation is not implemented. - [ ] **.leaders personal line.** Both .leaders handlers replay the same global snapshot without a personal result. - [ ] **Live checks.** No personal-best/no-record/backend-unreachable acceptance matrix is documented for the proposed feature. **Review notes** - node tools/check_leaderboard.mjs: 137 existing fixture/static checks passed for both games. These validate the global record implementation, not this absent feature. **Next steps** - Implement the per-player lookup and optional personal row without delaying the global record; cover both welcome and .leaders and document the three live scenarios.
Sign in to join this conversation.