Skip to content

feat(network): Send commands directly across the peer mesh - #661

Open
tintinhamans wants to merge 22 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/06-direct-send
Open

tintinhamans wants to merge 22 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/06-direct-send

Conversation

@tintinhamans

Copy link
Copy Markdown

Merge after #660.

Every player sent its commands to the packet router only and the router forwarded them, so a command of a non-router player took two hops and the router's upload carried the whole match. The mesh is already fully connected, so the second hop is extra latency and extra load on one machine.

With send.direct (true) every player sends its commands straight to each peer while every active peer has a direct mesh connection, and the acks come back from each peer. ConnectionManager::isDirectSendActive rechecks the links every 250 ms and logs [DIRECT] when the mode changes. When a connection drops or is not direct, commands fall back to the packet router. A peer that is quitting does not count, and a frame's latency is the slowest peer's round trip.

The arrival decides how a command is acked: one that came straight from its author is acked to it, one the router passed on is acked to the router, so peers in different modes still drain each other's acks. If the transport does not say who sent a packet (anticheat transport), the receiver's own mode is used. A peer that stops acking but is not yet removed holds back that frame's latency measurement until it is pruned, so the measured delay can be stale for those seconds.

send.direct is the only new key, on by default as in the tester build, and the service can turn it off. No wire change.

Tested: builds x86 Release z_generals. In the 3 player rig (full stack) a forced mixed direct and relay link drained its acks, 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/06-direct-send branch 2 times, most recently from 4410c4a to dc81af3 Compare October 25, 2026 12:53
@tintinhamans
tintinhamans force-pushed the arctic/go/stack2/06-direct-send branch from dc81af3 to d016ea6 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