Skip to content

Fix missing Discord notification for first player join after reconnect - #25

Merged
Xenne93 merged 1 commit into
mainfrom
fix/missed-first-connect-notification
Aug 17, 2026
Merged

Fix missing Discord notification for first player join after reconnect#25
Xenne93 merged 1 commit into
mainfrom
fix/missed-first-connect-notification

Conversation

@Xenne93

@Xenne93 Xenne93 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fixes a bug where the first player to join after the panel reconnects to a Rust server (e.g. after a server restart) never gets a 'player came online' Discord message, even though their disconnect fires fine and subsequent reconnects work normally.

Root cause: the suppress-player-events flag (set on every reconnect to avoid notifying for players already on the server) was only cleared inside the non-empty-playerlist branch of ParsePlayerList. If the first poll after reconnect found zero players online yet - the normal case right after a restart, since players take a bit to reconnect - the method returned early before ever clearing the flag. It stayed stuck true until a later poll found someone already online, silently dropping the connect notification for whoever joined live in between.

Fix: clear the flag right after every successful poll, regardless of whether the list is empty.

… reconnect

The suppress-player-events flag (set on every RCON (re)connect to avoid
notifying for players already on the server) was only ever cleared inside
the branch of ParsePlayerList that processes a non-empty player list. If
the very first playerlist poll after a reconnect found nobody online yet -
the common case right after a server restart, since players take time to
reconnect - the method returned early before reaching that code, leaving
the flag stuck true. Whoever joined live before the next poll (which
finally saw players and cleared the flag) had their connect webhook
silently and permanently skipped, even though their eventual disconnect
fired normally. Moved the flag-clearing logic to run right after every
successful poll, regardless of whether the returned list is empty.
@Xenne93
Xenne93 merged commit 91cdcd2 into main Aug 17, 2026
6 checks passed
@Xenne93
Xenne93 deleted the fix/missed-first-connect-notification branch August 17, 2026 10:34
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