Two loose ends left by #1326 and #1327. Neither is urgent; both are cheap once the rest
lands.
endTurn({ remove: true })
Superseded by events.unseat(id), which removes a player through the same path as
leaveGame rather than as a side effect of ending a turn. Worth deprecating rather
than removing, since it is public API.
It also has a bug. In the arg.remove branch, flow.ts:582 returns the state
parameter rather than the locally updated one, so the updated ctx is discarded and
removing the last player silently does nothing. Present since #492 (2018).
concepts.md says nothing about what these mean now
After #1326, ctx.numPlayers is the seat count the match was created with — not how
many players are in it. It is deliberately left alone so that no existing game changes
behaviour, but that makes it the wrong thing to read in a game that opts into seating,
where it goes stale. ctx.players.length is the live count.
ctx.playOrder also needs a line: it is who plays this phase, in order, and it is
always a subset of ctx.players.
Two loose ends left by #1326 and #1327. Neither is urgent; both are cheap once the rest
lands.
endTurn({ remove: true })Superseded by
events.unseat(id), which removes a player through the same path asleaveGamerather than as a side effect of ending a turn. Worth deprecating ratherthan removing, since it is public API.
It also has a bug. In the
arg.removebranch,flow.ts:582returns thestateparameter rather than the locally updated one, so the updated
ctxis discarded andremoving the last player silently does nothing. Present since #492 (2018).
concepts.mdsays nothing about what these mean nowAfter #1326,
ctx.numPlayersis the seat count the match was created with — not howmany players are in it. It is deliberately left alone so that no existing game changes
behaviour, but that makes it the wrong thing to read in a game that opts into seating,
where it goes stale.
ctx.players.lengthis the live count.ctx.playOrderalso needs a line: it is who plays this phase, in order, and it isalways a subset of
ctx.players.