Skip to content

Feat/custom mode player counts - #180

Open
LCrew wants to merge 3 commits into
5stackgg:mainfrom
LCrew:feat/custom-mode-player-counts
Open

Feat/custom mode player counts#180
LCrew wants to merge 3 commits into
5stackgg:mainfrom
LCrew:feat/custom-mode-player-counts

Conversation

@LCrew

@LCrew LCrew commented Sep 5, 2026

Copy link
Copy Markdown

No description provided.

LCrew and others added 3 commits September 4, 2026 21:09
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant