chore(network): Remove legacy Send Delay - #3007
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/GameNetwork/NAT.cpp | Removes Netgear-pair ordering in establishConnectionPaths(), probe delay in doThisConnectionRound(), and conditional probe suppression in probed()/gotMangledPort(); m_beenProbed is still read in connectionUpdate() to stop retrying mangled-port sends, so it remains live. |
| Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp | Strips FIREWALL_TYPE_NETGEAR_BUG set-up from detectionBeginUpdate(), removes hardness/retries contributions, and cleans up dead #if(0) block; all remaining logic is unaffected. |
| Core/GameEngine/Include/GameNetwork/FirewallHelper.h | Renames FIREWALL_TYPE_NETGEAR_BUG to FIREWALL_TYPE_UNUSED (preserving value 8 to avoid future bitmask collisions) and removes both isNetgear() overloads. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | Removes checkSendDelay static variable and all save/load/set-defaults calls; hides the checkbox at runtime via #if ENABLE_GUI_HACKS (always defined to 1) without touching the .wnd file yet. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | Mirrors the Generals OptionsMenu changes: removes checkSendDelay state and save/load; hides checkbox via #if ENABLE_GUI_HACKS. |
| Generals/Code/GameEngine/Include/Common/GlobalData.h | Drops m_firewallSendDelay field; no other member changes. |
| GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | Mirrors Generals GlobalData.h: drops m_firewallSendDelay field. |
| Core/GameEngine/Source/Common/OptionPreferences.cpp | Removes getSendDelay() implementation; remaining preference accessors unchanged. |
| Core/GameEngine/Include/GameNetwork/NAT.h | Removes already-commented-out NATCONNECTIONSTATE_NETGEARDELAY enum value; no other changes. |
Sequence Diagram
sequenceDiagram
participant Local as Local NAT
participant Mangler as STUN Mangler
participant Remote as Remote NAT
Note over Local,Remote: Simplified flow after SendDelay removal
Local->>Mangler: Probe (STUN request)
Mangler-->>Local: Mangled port response
Local->>Remote: gotMangledPort → sendAProbe (immediately, no delay)
Local->>Remote: notifyTargetOfProbe
Note over Local: state = WAITINGFORRESPONSE
Remote->>Local: Probe packet
Local->>Remote: "probed() → m_beenProbed=TRUE"
Note over Local: connectionUpdate() stops retrying mangled port sends
Remote-->>Local: Connection response
Note over Local,Remote: Connection established (DONE)
Reviews (4): Last reviewed commit: "review feedback" | Re-trigger Greptile
|
Left one question, otherwise this looks good |
xezon
left a comment
There was a problem hiding this comment.
How confident are we that no player never ever needs this delay thing?
|
Highly confident. |
|
Ok. I am not opposed to removing it. |
What this code did:
The
SendDelaysetting (m_firewallSendDelay) enabled a specialized NAT traversal mode (FIREWALL_TYPE_NETGEAR_BUG) inFirewallHelper.cppandNAT.cpp:m_timeTillNextSend = -1) on outbound UDP STUN/probe packets sent to peer players.NAT::establishConnectionPaths(), it rearranged player connection slots into special pairs for nodes identified as having the Netgear NAT bug.NAT::probed()andNAT::gotMangledPort(), it blocked local clients from sending reciprocal NAT probes until the remote peer probed them first.SendDelay = yes/noinOptions.ini.Background & Reason for Removal:
SendDelay = noinOptions.ini. In reality, it had zero effect on in-game performance.NAT.cpp, removes dead code acrossFirewallHelper,OptionPreferences, andGlobalData, and hides the obsolete setting from the Options GUI.