Leaderboards

Backed by: @pithy-sh/leaderboard. Scopes: leaderboard:entries:read · leaderboard:entries:moderate.

What it shows

Leaderboard is the capability it reads, boards and windows is what a window is, and the reference has the routes behind every read and act here.

The boards your game ranks players on, and the entries in each one’s open window, read live from your Worker. It appears in the rail beside Ledger when your Worker composes leaderboard, at whatever path you mounted it.

The index lists every board. Each row carries its key, which way it ranks (Higher wins or Lower wins), how a player’s repeat scores combine (best, latest or sum), and its window: a schedule, or All time. Its filters, Window (windowed or all time) and Direction, narrow the boards read. The overview is how the filter panel works.

The record is one board. Its store, direction, how repeats combine, its schedule, the window open now, the bounds a score must fall within, and whether ranks are counted on every read or stored and renumbered by each refresh. Under those come its entries and its refresh lock.

Entries are the open window, ranked, a page at a time, with hidden entries in place. Each one carries its rank, the player, the score, when it was achieved and when it was submitted, and the result that submitted it when there was one. An entry a moderator hid says so, and so does one whose player opted out. Visibility, above the entries, is sent to your Worker as the entries route’s hidden: Any, hidden only, or shown only, carried onto every next page. A window with no entry of that visibility says so, and the acts say to choose Any rather than calling the window empty.

The refresh lock is shown when one is held: its name, who holds it, and since when.

Hiding, unhiding and correcting an entry

Four acts: hide an entry, unhide one, correct a score, and clear the refresh lock. Each one previews exactly what it will change, asks for a reason, and confirms once.

ActWhat it does
Hide an entryPlayers stop seeing it. The score is kept
Unhide an entryPuts a hidden entry back on the board
Correct a scoreSets a new score within the board’s bounds. Your Worker keeps the original, and the answer shows both
Clear the lockReleases a refresh lock whose refresh stopped. The next refresh takes it fresh

What is shown after an act is your Worker’s answer. The record reads again after every one. On a board whose ranks are stored, a change shows in the ranks after the next refresh, and the answer says so.

Each opening of an act mints one idempotency key, and every press of that opening sends it. A press whose answer was lost and is pressed again gets Already done, and nothing changes a second time. An act that changed nothing says so: an entry that was already hidden, or a score it already held.

A refusal your Worker names stays in the question, with what you typed, so you can fix it and press again: the board or entry is gone, the score is outside the board’s bounds, or the key was already spent on another act.

Each act is written to the dashboard’s own audit record: who did it, the board and player or the lock, the act, the reason, and whether it changed anything. Never a score.

On every plan, and on Team

The reads render on every plan. Seeing a board, its entries and its lock costs nothing.

The four acts are Team. Below it they are drawn locked, saying what Team buys.

Two scopes, a read and a write

leaderboard:entries:read is every read here, and it is a read, so it is in the default grant. A connection without it sees the pane refuse by name and send nothing. Scopes has how to add one to a connection made before it existed.

leaderboard:entries:moderate is all four acts, and it is a write, so it is never in the default grant. A connection without it shows the acts unavailable, with the scope they need.

It keeps nothing

Submitting a score and creating a board are not buttons here. Those belong to your game.

Nothing here is kept. Boards, entries and locks are fetched from your Worker for this screen and held in no Pithy table.

ESC