five-on-it / apps/api/src/missions-index
apps/api/src/missions-index
The missions' index (GAME_DESIGN §13, TECHNICAL_SPECS §9.6): every mission of the games a player may find, with how it is played and the public lobbies gathering for it, over the curated games (a level that ships, its bundled game: games.ts) and the latest versions of the public published games a moderator did not take down. The GameCatalog beneath it is what the lobbies (lobbies.ts) and Quick play (matchmaking.ts) read too: a game by its id (a published one shared by link included) with its document, its creator, its rating and how a run of it is opened (runs.ts' RunGame), and every listed game's missions.
A published version's document is the game as it was built (source.game), else its artifact's, read once per version and kept: a version never changes (one that does not read, a corrupt artifact, is left out and logged). Beside it the catalogue keeps that document as its creator wrote it, in this release's format and without the schema's defaults (source: what a mission's version is hashed by, as the game server hashes the run's), and its creator's account (owner). The listed games' missions are made again at most every CATALOG_TTL_MS: the index, the playlists and the vote read them often.
| Route | Who | What |
|---|---|---|
GET /missions?mode=&players=&level= | signed in | The listed games' missions (@foi/protocol's MissionEntry): solo, co-op or versus, taking so many players, on a level; each with its teams and its public lobbies. |