Repository navigation
fix(network): Synchronize disconnect removal and quit handling - #662
Open
tintinhamans wants to merge 9 commits into
Open
tintinhamans wants to merge 9 commits into
tintinhamans wants to merge 9 commits into
Conversation
tintinhamans
force-pushed
the
arctic/go/stack2/07-disconnect-quit
branch
4 times, most recently
from
October 26, 2026 15:39
bba753e to
05afd00
Compare
…and forwarded traffic
tintinhamans
force-pushed
the
arctic/go/stack2/07-disconnect-quit
branch
from
October 28, 2026 01:47
05afd00 to
fbb383a
Compare
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.
Merge after #661.
A leaving player could be removed on different frames on different machines, a graceful quit waited out the whole timeout like a dead connection, a leave notice about any slot was trusted from any peer, and the log lines of a dead connection were not limited.
DisconnectManagernow removes a player on the same frame everywhere. The acting packet router decides the removal and carries the frame, and everyone that got a leave from the leaver tells the others, so all pick the same next router. Frames of the removed player that others still miss can be asked for again. A peer that closes its connection on purpose during a match is treated as left and removed without waiting for the timeout. That is read from the GNS end debug string, which is fragile if its wording changes. Slots outside0 <= slot < MAX_SLOTSare rejected. A leave notice is trusted from the leaver itself or with the leaver's match key signature, andDISCONNECTPLAYERis applied only from the acting router.Two keys are new:
disconnect.freeze_before_screen_ms(5000) is how long a player is stuck before the disconnect screen comes up,disconnect.remove_after_ms(60000) how long a silent player stays on it.[DISC] Recv Failedand "connection is invalid" are limited to once per 5 s per connection, send failures to once per second, and a packet is dropped after 3 failed retries.A leaver without a match key yet sends an unsigned notice, so the others fall back to the timeout and vote. The signature does not cover the frame, so a captured notice can be replayed in the same match. No wire change here, the signature field comes from the identity PR.
Tested: builds x86 Release
z_generals. In the 3 player rig (full stack) both survivors removed the killed host on the same frame, 0 CRC mismatches, n=1.