Skip to content

fix(games): reconcile player connection status via periodic rcon status - #792

Open
garrappachc wants to merge 2 commits into
masterfrom
fix/periodic-connection-status-sync
Open

fix(games): reconcile player connection status via periodic rcon status#792
garrappachc wants to merge 2 commits into
masterfrom
fix/periodic-connection-status-sync

Conversation

@garrappachc

Copy link
Copy Markdown
Member

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 stays offline and 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 connected it didn't cancel the already-scheduled auto-sub.

What

  • Run the gameserver's status command 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).
  • When a status update reports a player as non-offline, cancel any pending games:autoSubstitutePlayer task — so a status sync that finds the player present actually calls off the substitution.
  • Extract the reconciliation into a testable syncPlayerConnectionStatus() and replace the one-shot startup plugin with an interval-driven one (still runs once on boot).

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>
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  243 passed
flaky  3 flaky

Details

stats  246 tests across 47 suites
duration  13 minutes, 2 seconds
commit  bcc618e

Flaky tests

chromium › 20-game/03-update-player-connection-status.spec.ts › update player connection status @6v6 @9v9
chromium › 20-game/09-auto-substitute-requests.spec.ts › when a player does not connect to the gameserver on time @6v6 @9v9 › should request substitute for them @6v6 @9v9
chromium › 20-game/09-auto-substitute-requests.spec.ts › when a player replaces another player and does not join the gameserver @6v6 @9v9 › before the match starts @6v6 @9v9 › should request substitute for them @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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant