Repository navigation
bugfix(disconnectmanager): Fix the DC bug and leftover objects when a player quits from the disconnect screen - #3631
Conversation
WalkthroughThe networking code records the sender slot for incoming packets and uses it to validate disconnect commands. DisconnectManager adds non-retail leaver tracking and retail-compatible relay handling. It also updates voting, frame selection, player cleanup, and disconnect-screen progression. ChangesNetwork Disconnect Handling
Priority: Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Peer
participant ConnectionManager
participant DisconnectManager
participant OtherPeers
Peer->>ConnectionManager: Send packet with address and port
ConnectionManager->>ConnectionManager: Resolve sender slot
ConnectionManager->>DisconnectManager: Process disconnect command with current sender slot
alt Non-retail networking
DisconnectManager->>OtherPeers: Notify peers of a leave
else Retail-compatible networking
DisconnectManager->>OtherPeers: Send pending relay when the disconnect frame matches
end
Possibly related PRs
Suggested reviewers: Merge Risk:
|
2706f0b to
d777a0c
Compare
…the disconnect screen
[Medium impact] The PR appears safe to merge; no new blocking issue was found.
|
There was a problem hiding this comment.
Actionable comments posted: 4

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9d4db0d0-aa0b-41c9-bafa-5df1a2f560d4
Files selected for processing: 4-
Core/GameEngine/Include/GameNetwork/ConnectionManager.hCore/GameEngine/Include/GameNetwork/DisconnectManager.hCore/GameEngine/Source/GameNetwork/ConnectionManager.cppCore/GameEngine/Source/GameNetwork/DisconnectManager.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
d777a0c to
49e4900
Compare
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c5cfb5ae-04da-4049-8603-10e8d6cb92ad
Files selected for processing: 2-
Core/GameEngine/Include/GameNetwork/DisconnectManager.hCore/GameEngine/Source/GameNetwork/DisconnectManager.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
f800dbc to
5b37297
Compare
5b37297 to
31331c7
Compare
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7783430f-8dfa-4186-9bac-90d160df8e60
Files selected for processing: 2-
Core/GameEngine/Include/GameNetwork/DisconnectManager.hCore/GameEngine/Source/GameNetwork/DisconnectManager.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
Fixes #292
Fixes #2013
DisconnectManager::processDisconnectPlayerremoves a player that quits from the disconnect screen on whatever frame each player got the leave on, and nobody sends a destroy for it. A player the leave misses waits for a disconnect command only the packet router sends. So players can be stuck on the disconnect screen for good (the DC bug), remove the quitter on different frames, and its objects stay.Every player that stays now sends the destroy, and the next packet router passes the leave on to players stalled on its frame. A disconnect command also has to come from the address of the player it claims to be from, so a faked leave can't destroy someone's objects. This is retail compatible.
Non-retail builds go further. A leave only marks the player, and the acting packet router removes it on one frame for everyone, same as it already does for a timed out or voted out player.
Scripted 4 player LAN games, 3 runs per case: