Repository navigation
feat(spectator): let late joiners watch the running round - #443
Merged
Merged
Conversation
A player who connects while a round runs is no longer refused. Late joiners take one of the maxSpectators places and spawn as spectators in the running map. The lobby limit does not apply to them, and a full set of places is refused with a message of its own.
Players who join a running round are tagged as spectators, but the role allocation and the wake-up camera still used every online player. A late joiner could be drawn as the Slender or handed a survivor role. The allocation now skips spectators, and the wake-up camera opens only for the players who take part in the round.
Contributor
Test results 879 files 879 suites 7m 26s ⏱️ Results for commit f9b9586. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Until now, a player who connected while a round was running was turned away with "the game has already started". They could not play and could not watch the round either, and had to wait for the restart. This PR implements the proposal from #442: a late joiner becomes a spectator.
maxSpectators(default 8) limits the places. Only late joiners count against it; players who died in the round already had a player slot. When the places are full, the player is turned away with "All spectator places are taken."maxSpectators=0brings back the old refusal.maxPlayersnow applies in the lobby only.Turning a player away still happens only once they are in the play state, never during configuration, so the proxy crash with duplicate registry entries stays fixed.
The proposal (#442) is not merged yet. This PR contains no file under
openspec/.Types of changes
Checklist
Further comments
./gradlew buildpasses, with 1565 tests in:gameand no failures. Not yet tested live with a second client during a running round. That can be done on staging.To get the old behaviour back, set
maxSpectators=0. TheGameConfig.Roundrecord has a new fifth field; a four-argument constructor with the default keeps existing callers working.