Skip to content

feat(online): Turn on Wi-Fi media streaming mode while a match runs - #667

Open
tintinhamans wants to merge 28 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/12-wifi-low-latency
Open

tintinhamans wants to merge 28 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/stack2/12-wifi-low-latency

Conversation

@tintinhamans

Copy link
Copy Markdown

Merge after #666.

On Wi-Fi, background network scans can cause latency spikes, and in a lockstep game every player sees that as a stall. While a match runs the game now asks the Wi-Fi driver for media streaming mode for the adapter that carries the game traffic, found from the default route. On Ethernet or without Wi-Fi nothing happens.

wlanapi.dll is loaded at run time and a worker thread makes the calls, since they can block in the WLAN service. It only sets the mode when it is not on yet, rechecks on a Wi-Fi notification and every 60 s, and reopens the WLAN handle if the service restarts. If Windows refuses the call, the failure is logged and nothing changes. The mode applies to the whole adapter while it runs, so other apps on it are affected too. It starts in NGMPGame::launchGame and ends in ~Network and the online services shutdown.

connection.wifi_low_latency in the service config turns it off, it is on by default.

Tested: builds x86 Release z_generals. Not run in a match, and no stalls were measured with and without it.

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/12-wifi-low-latency branch from e1a0bf2 to 05f682b Compare October 25, 2026 11:16
@tintinhamans
tintinhamans force-pushed the arctic/go/stack2/12-wifi-low-latency branch from 05f682b to d43ab08 Compare October 25, 2026 12:54
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