You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lobby lifecycle: give MatchData a status instead of inferring it from seat occupancy #1328
Server.MatchData (types.ts:408) has no field for "has this match started", so the
lobby infers it from seat occupancy — a match is running once every seat has a name.
That works while every match has a fixed number of seats. It is never true for a table
you can join, so it blocks #1327.
interface MatchData {
gameName: string;
players: { [id: number]: PlayerMetadata };
+ status: 'open' | 'running'; // the lobby's lifecycle, not the game's+ creator?: PlayerID; // who may start it
gameover?: any;
}
Plus POST /games/:name/:id/start and LobbyClient.startMatch. Fixed-seat matches still
flip to running on their own when the last seat fills, so nothing changes for them.
Two things read the seat count and shouldn't
plugin-player builds G.players from ctx.numPlayers at setup
(plugin-player.ts:86) and short-circuits opponent on ctx.numPlayers === 2
(plugin-player.ts:70).
- if (ctx.numPlayers === 2)+ if (game.minPlayers === 2 && game.maxPlayers === 2)
What the game declared is stable for the life of the match; the live count is not. The
plugin also needs a hook, or a newly seated player never gets a G.players entry.
The React lobby counts filled seats to decide whether to show Play. It should read status, and create matches at minPlayers.
Activity