feat(multiplayer): handle player disconnect during in-progress game #5
Labels
No labels
feature
multiplayer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: forgejo-lila/lila#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Currently, when a player disconnects during an in-progress game,
handleLobbyLeaveremoves them from the lobby and broadcasts theupdated state. The game continues with remaining players, and the
disconnected player's answers time out each round via the 15s timer.
This is acceptable for the initial slice but has two known gaps:
Gap 1: Single player remaining
If a disconnect leaves only one player in the game, the game should
end immediately and declare that player the winner. Currently the game
continues until all rounds complete, with the remaining player answering
alone.
Gap 2: No reconnection
A disconnected player cannot rejoin an in-progress game.
handleLobbyJoinrejects non-waiting lobbies. When reconnection handling is added, this
check needs to be revisited.
Acceptance criteria
immediately via
game:finishedwith the remaining player as winner.N seconds and resume from the current question.
Related
apps/api/src/ws/handlers/lobbyHandlers.ts—handleLobbyLeaveapps/api/src/ws/handlers/gameHandlers.ts— game state management