Skip to content

fix(network): Synchronize disconnect removal and quit handling - #662

Open
tintinhamans wants to merge 23 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/07-disconnect-quit
Open

tintinhamans wants to merge 23 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/07-disconnect-quit

Conversation

@tintinhamans

Copy link
Copy Markdown

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.

DisconnectManager now 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 outside 0 <= slot < MAX_SLOTS are rejected. A leave notice is trusted from the leaver itself or with the leaver's match key signature, and DISCONNECTPLAYER is 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 Failed and "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.

xezon added 7 commits October 24, 2026 23:10
…ile::getFileInfo(), StdBIGFile::getFileInfo() (TheSuperHackers#3415)

(cherry picked from commit b805c12)
…File (TheSuperHackers#3505)

Both classes are identical apart from their name and contain no platform specific code.
Nothing in them depends on the BIG format either: they open a file from an offset and a
size inside the archive file. ArchiveFile takes over their functions and is no longer an
abstract class.

(cherry picked from commit 52a777a)
…ystem into BIGFileSystem (TheSuperHackers#3505)

Both classes are identical apart from their name and go through the local file system
for all file access. The one class that remains sits next to ArchiveFileSystem in
Core/GameEngine.

(cherry picked from commit e4b4d1e)
…e loadBigFilesFromDirectory (TheSuperHackers#3505)

loadMods refers to BIG files, which nothing else in ArchiveFileSystem does. It becomes a
virtual function that BIGFileSystem implements. loadBigFilesFromDirectory is renamed to
loadArchiveFilesFromDirectory, because the base class is not tied to one archive format.

(cherry picked from commit f299561)
@tintinhamans
tintinhamans force-pushed the arctic/go/stack2/07-disconnect-quit branch 2 times, most recently from 18052cb to bba753e Compare October 25, 2026 12:53
@tintinhamans
tintinhamans force-pushed the arctic/go/stack2/07-disconnect-quit branch from bba753e to 05afd00 Compare October 26, 2026 15:39
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.

2 participants