refactor(network): Remove legacy Send Delay#3007
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/GameNetwork/NAT.cpp | Removes Netgear-specific connection-pairing, probe-delay, and gotMangledPort gating logic; expands #if DEBUG_LOGGING guard correctly around variables now only used for logging |
| Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp | Removes all FIREWALL_TYPE_NETGEAR_BUG detection branches, hardness/retry adjustments, and dead #if(0) block; remaining code paths are unaffected |
| Core/GameEngine/Include/GameNetwork/FirewallHelper.h | Removes FIREWALL_TYPE_NETGEAR_BUG = 8 enum value and both isNetgear() method overloads; no downstream bitmask arithmetic is broken since all call sites are also removed |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | Removes static checkSendDelay global, hides the widget via a local lookup with a null guard, and drops all save/load/enable logic; also fixes a pre-existing potential null dereference on winEnable(FALSE) |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | Mirrors the Generals OptionsMenu.cpp changes; same pattern of hiding the widget via a local variable with null guard |
| Generals/Code/GameEngine/Include/Common/GlobalData.h | Removes m_firewallSendDelay Bool field; paired correctly with removal of initialization and ini-loading in GlobalData.cpp |
| GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | Mirrors Generals GlobalData.h; removes m_firewallSendDelay field |
| Core/GameEngine/Source/Common/OptionPreferences.cpp | Removes getSendDelay() implementation; existing Options.ini files with SendDelay key will have the entry silently ignored, which is correct backward-compatible behavior |
| Core/GameEngine/Include/Common/OptionPreferences.h | Removes getSendDelay() declaration; straightforward header cleanup |
| Core/GameEngine/Include/GameNetwork/NAT.h | Removes already-commented-out NATCONNECTIONSTATE_NETGEARDELAY enum value |
Sequence Diagram
sequenceDiagram
participant A as Client A (local)
participant M as Mangler Server
participant B as Client B (remote)
Note over A,B: After this PR - unified path for all NAT types
A->>M: sendMangledSourcePort()
M-->>A: mangledPort response
A->>A: processManglerResponse(mangledPort)
A->>B: gotMangledPort - sendAProbe() + notifyTargetOfProbe()
A->>A: "state = WAITINGFORRESPONSE"
B->>M: sendMangledSourcePort()
M-->>B: mangledPort response
B->>B: processManglerResponse(mangledPort)
B->>A: gotMangledPort - sendAProbe() + notifyTargetOfProbe()
B->>B: "state = WAITINGFORRESPONSE"
A-->>B: "PROBE received - probed() - m_beenProbed = TRUE"
B-->>A: "PROBE received - probed() - m_beenProbed = TRUE"
A->>A: "state = DONE"
B->>B: "state = DONE"
Reviews (2): Last reviewed commit: "refactor(network): Use NAMEKEY macro for..." | Re-trigger Greptile
|
Left one question, otherwise this looks good |
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.