Backed by: @pithy-sh/multiplayer. Scopes: multiplayer:sessions:read · multiplayer:sessions:moderate.
What it shows
Multiplayer is the capability it reads, and the reference has the routes behind every read and act here.
The sessions your players are in, and how each finished one ended, read live from your Worker. Two kinds appear in the rail beside Leaderboards when your Worker composes multiplayer, at whatever path you mounted it: Game sessions and Game results.
Game sessions lists the sessions in play, newest first, a page at a time. Each row carries its phase (Filling, In play, Finished or Abandoned), how many players it has, and how long it has been open. Game and Phase are sent to your Worker, so they answer over every session; Game offers the game keys the sessions read carry, as you named them. Older than 1, 7, 30 or 90 days narrows this page only.
The record is one session, as its Durable Object answers. Its game, its model, whether it is one game or a table of many rounds, its phase, when it opened and its deadline, or that it waits for none. Under those come its players, each one connected, not connected, or gone, and, once it has ended, how. A session an operator closed shows the reason its players were told. Never the game’s own state, which holds what a player must not see.
Game results lists how each finished session ended, most recently ended first, a page at a time. Each row carries the ending (won by a player, a draw, no winner, or abandoned), whether it still counts, and when it ended. Game and Voided (voided only, or counted only) are sent to your Worker, so they answer over every result. The overview is how the filter panel works.
The record is one result: its status and ending, when it started and ended, whether it counts, and each player with their score and who won. A voided result also shows when it was voided and what each consumer did with the void.
Closing a session and voiding a result
Two acts: close a session that is stuck, and void a result that should not count. Each one previews exactly what it will change, asks for a reason, and confirms once.
| Act | What it does |
|---|---|
| Close the session | Tells its players your reason and closes their sockets. It records no result. A table settles each seated player out first. Offered only while the session is still in play |
| Void the result | The result stops counting. Where leaderboard is composed, the entries it submitted are removed; where rating is composed, the ratings it touched are recalculated. The confirmation names which of those will run |
After a void, the record says what each consumer did, by name: took it back, failed, or has not answered yet. A failure is named, and voiding again runs it. One that has not answered may still be running, and the record says to void again once the void’s 15-minute lease has passed. A result every consumer took back offers no void.
What is shown after an act is your Worker’s answer. The record reads again after every one, and a voided result stays open in the record even when the re-read no longer lists it on the first page.
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 closed or Already voided, and nothing changes a second time.
A refusal your Worker names stays in the question, with what you typed, so you can fix it and press again: the session is gone or has already ended, the result is not there, or the key was spent on another void or a void of it is still running.
Each act is written to the dashboard’s own audit record: who did it, the session, the game, the reason, whether it changed anything, and, for a void, how each consumer stood. Never a player, and never a score.
On every plan, and on Team
The reads render on every plan. Seeing the sessions in play, their players and the results costs nothing.
The two acts are Team. Below it they are drawn locked, saying what Team buys.
Two scopes, a read and a write
multiplayer:sessions: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.
multiplayer:sessions:moderate is both 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
Starting a session and recording a result are not buttons here. Those belong to your game.
Nothing here is kept. Sessions and results are fetched from your Worker for this screen and held in no Pithy table.