Feat/custom mode player counts - #180
Open
LCrew wants to merge 3 commits into
Open
Conversation
GetExpectedPlayerCount() read a hard-coded 10/4/2 off options.type, which
is one of the four copies of that fact across the stack. The panel can now
size a match from its custom game mode, so it sends the resolved
per-lineup minimum in options.min_players_per_lineup.
When that field is set it wins, and the count is starters only -- the same
thing the type table below it counts, since a Competitive match expects 10
whether or not substitutes are rostered. Reading the lineups directly
would count those substitutes and hang warmup waiting for players who were
never required.
That single branch carries the ready check, the short-handed auto-pause at
round start, pause/resume on disconnect and reconnect, bot fill, the round
restore gate and the surrender vote.
Two places need more than the total:
* the per-team join cap is now taken from the player's own lineup, so
the third player of a 3v2 is not kicked on connect.
* the ready check needs >= rather than ==, but only for a flexible
match: an uneven roster reports the smaller side as its minimum, so
more players can ready up than expected and an equality would never
fire. Every other match keeps the exact == it has always used.
Null on every existing match, so nothing changes without a custom mode.
Mirrored across both the CounterStrikeSharp and Swiftly runtimes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8LmkD3i1HyGjbcxAZ5Crz
min_players_per_lineup travels from the panel as JSON, so a rename or a serializer change breaks it silently: the server falls back to the type's 10/4/2 and sits in warmup waiting for players who were never rostered. From the outside that looks like a panel bug, not a deserialization one. Covers both directions -- a sized mode expecting its own count, and a plain Wingman still expecting four, which is the half that proves an ordinary match is untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8LmkD3i1HyGjbcxAZ5Crz
The panel records the smaller side in min_players_per_lineup, because its own gates apply that one number to both lineups. Doubling it therefore under-counts an uneven start: a 1v2 asked for 2 and could take the match live with the third player still connecting. It now sends the total outright when the sides are uneven, so prefer that and fall back to doubling only when it is absent. Even starts are unchanged, and a match with no short-handed start still reads its type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8LmkD3i1HyGjbcxAZ5Crz
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.
No description provided.