five-on-it / packages/protocol/src/platform
packages/protocol/src/platform
The contract between the platform API (apps/api) and the game servers: what a built game is on the wire (the artifact: the level data and the game document, stored by the hash of its content), how the API asks a game server to open a room for one (or for a level that ships, its bundled game: bundled), and the join token a player connects to a room with (an HS256 JWT both sides sign and check with the room secret they share; it names the room, the player's account, the name to show and the player's party, a run's seat and team, and expires within minutes). A public room's request names where the game server asks the platform's moderation about its chat.
A run (TECHNICAL_SPECS §9.5, §9.6) is a room opened for one mission and its roster: its RunSpec names the run, the game and the mission, the seats (each an account, its name and team), where the game server reports the run's RunResult when it ends and the token it reports with (made by the API for that run alone), and whether it is a creator's playtest (which counts for nothing). A live run that takes players under way advertises its open seats in its room's status (RoomStatus.open), and the API adds a seat for a player it placed (POST /rooms/:id/seats with a RunSeatSpec, the room secret as the bearer: {seat}, the seat's index, or 409 with why).
Interfaces
Type Aliases
Variables
- BuildManifest
- FleetHeartbeat
- GameArtifact
- RoomOpenRequest
- RoomStatus
- RUN_ID_PATTERN
- RunResult
- RunSeatSpec
- RunSpec