fix(games): reconcile player connection status via periodic rcon status - #792
Open
garrappachc wants to merge 2 commits into
Open
fix(games): reconcile player connection status via periodic rcon status#792garrappachc wants to merge 2 commits into
garrappachc wants to merge 2 commits into
Conversation
A dropped UDP log line could leave a present player marked offline and get them wrongly substituted. Poll the gameserver's status command every 30s to reconcile slot connection status, and cancel a pending auto-sub once a player is confirmed present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Playwright test resultsDetails
Flaky testschromium › 20-game/03-update-player-connection-status.spec.ts › update player connection status @6v6 @9v9 |
Record a playerLeftGameServer event when the status sync marks a slot offline, so the auto-sub timeout is measured from now instead of the epoch (which substituted the player instantly). Leave joining/connected slots untouched to keep the joining distinction, and chain sync runs so a slow pass can't overlap and double-emit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
Slot connection status is driven purely by UDP log lines from the gameserver (
connected/joined team/disconnected). When a packet is dropped, a slot staysofflineand the player gets wrongly substituted for being "offline", even though they're on the server.The existing status reconciliation only ran once at startup (#467), and even when it re-marked a player
connectedit didn't cancel the already-scheduled auto-sub.What
statuscommand every 30s for each running game and reconcile each slot's connection status (one command per game per pass — no per-player probing, so no spam when many players' timeouts are near).games:autoSubstitutePlayertask — so a status sync that finds the player present actually calls off the substitution.syncPlayerConnectionStatus()and replace the one-shot startup plugin with an interval-driven one (still runs once on boot).