Repository navigation
feature: Player Management counts assists, headshots, damage, rounds and MVPs for the community stats - #282
Merged
Merged
Conversation
…e map, so the panel can keep a map's last kills on that map The roster sends the counts it had when a map ended in a sync of its own, before it holds through the map change, and every sync names the map. A map-end report the panel misses is sent again, and given up after the hold cap so it cannot hold up the reports after it. Panels that predate per-map sessions ignore the map.
…nd the map is read from the map load event A roster that changed over the map change differed from the pending report on every poll, so each poll became a sync until the report was taken. The map name now comes with SwiftlyS2's map load event, and a plugin only asks the engine for it on a hot reload, where it has missed that event and the engine has a map to answer with.
…and MVPs for the community stats Each connection now keeps running totals of assists, headshots, damage, rounds played, rounds won and MVPs next to its kills and deaths, and sends them on the roster and with every departure. Flash assists, team damage and warmup rounds do not count, a headshot only counts with a counted kill, and a lethal hit is credited only with the health the victim had left. Panels that predate the counters ignore them.
Kills, deaths, assists, headshots, damage and MVPs are now dropped while the game rules say warmup is on, the same way warmup rounds already were. The flag is read at each event, so it holds however long warmup runs and however it ends; a server without warmup counts everything.
Flegma
marked this pull request as ready for review
October 30, 2026 10:17
…end report, and a kill during the hold stays out of it
…r had, read off the pawn every second
…ts once its freeze time ends outside warmup
… next round's start, so a second round end before then adds nothing
…cks the new map's roster, not the snapshot taken at the map's end
…oo, so it closes the round's MVP like any other
…e-counters # Conflicts: # apps/player-management-css/src/PlayerManagementPlugin.cs # apps/player-management-sw/src/PlayerManagementPlugin.cs # apps/player-management-sw/test/PlayerRosterTests.cs # shared/dotnet/FiveStack.Utilities/PlayerRoster.cs
… side they spawned on, so sitting on a side or joining the winning one farms no rounds
…they claim, and leaving a side or the game restarting forgets it
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.
Player Management counts the stats that 5stackgg/api#886 stores. Stacked on #281 (merge that first).
What
PlayerRoster.cs: each connection keeps running assists, headshots, damage, rounds played, rounds won and MVPs, reset with a new conn like kills and deaths, and carried on departed entries.Died(victim, killer, warmup, assister, headshot),Hurt,RoundEnded,Mvp, all under the roster lock. Each takes a requiredwarmupflag and drops the event when it is set.PlayerSanction.cs: the six fields onRosterPlayerandDepartedPlayer(snake_case, ignored by older panels).WarmupPeriodat the event, so no warmup convar is read, and it holds for any warmup length,mp_warmup_endor a paused warmup. Unreadable rules count as live, as on a server without warmup. Kills and deaths counted in warmup before this PR.Open points from review
Tests
apps/player-management-sw/test: 158/158 (one new test for warmup) inmcr.microsoft.com/dotnet/sdk:10.0. Both plugins build.