taking longer than usual.

skip to content
sometimes/ developers

developers / games / build your game

lobbies & rounds

implement lobby settings, match phases and round transitions in your server rules, using host checks and scheduled deadlines.

API 1 · SDK 1.0.2download reference

host and settings

ctx.host identifies the host. use requireHost(ctx) and requireRevision(data.revision, ctx) for lobby edits. validate settings and lock them on start. host departure transfers the role to the earliest active player.

countdowns and transitions

deadline returns an absolute timestamp. sometimes persists it and calls timer after that time, including after a restart. use ctx.now for decisions and game.clock.now() for client countdowns.

deadline(state) { return state.nextAt; },
timer(state, ctx) {
  if (state.nextAt !== null && state.nextAt <= ctx.now) {
    state.phase = "playing";
    state.nextAt = null;
  }
}

match phases

define phases, rounds, teams, turns and rematches in your game state and validate the actions that change them. games can use a fixed number of rounds, continue indefinitely or operate without rounds. Wordle implements lobby settings, countdowns, round results and a separate final podium.