bug: stop stacked leaver bans and missed auto-resume on reconnect - #184
Merged
Merged
Conversation
- one leave could be reported as several abandons (after a reconnect, and again on each map of a series), and the api escalates the ban per report - SetupDisconnectTimer overwrote a live timer without killing it, leaving an orphan that fired its own abandon - player_connect_full runs before the connecting player is on the runtime's player list, so the auto-resume check came up a man short and the match stayed paused until someone typed .resume - the resume check counted everyone on the server, so a caster or admin could satisfy it while a player was still missing
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.
Both fixes are applied to both runtimes (counterstrikesharp and swiftly).
Stacked leaver bans
One leave could be reported as several abandons, and the api escalates the cooldown on every report:
SurrenderSystem.Reset()runs per map, so each map of a series could report the same player again;SetupDisconnectTimeroverwrote a stored timer without killing it, leaving an orphan thatCancelDisconnectTimercould never reach and that fired its own abandon.Reports are now deduplicated per match (the set survives the per-map reset and is cleared only when a different match loads), and any existing timer for a steam id is killed before a new one is stored, across every team bucket.
The api side is covered separately by a unique constraint in 5stackgg/api#409.
Match stayed paused after a reconnect
player_connect_fullfires before the connecting client is on the runtime's player list, so the roster count came up one short and the auto-resume was skipped. The check now runs a frame/tick later. It also counted every player on the server, so a caster or an admin could satisfy it while a player was still missing; it counts roster players now. Tactical and technical pauses are still left to the teams.Tests: 57 (css) and 106 (swiftly), each +3 for the extracted roster-count helper.
SurrenderSystemitself is not reachable from the test projects — it takes live CS2 state — so that half is verified by build only.