diff --git a/Core/GameEngine/Include/Common/OptionPreferences.h b/Core/GameEngine/Include/Common/OptionPreferences.h index 1f45873191a..85aba4228be 100644 --- a/Core/GameEngine/Include/Common/OptionPreferences.h +++ b/Core/GameEngine/Include/Common/OptionPreferences.h @@ -84,7 +84,6 @@ class OptionPreferences : public UserPreferences Bool getScreenEdgeScrollEnabledInWindowedApp() const; Bool getScreenEdgeScrollEnabledInFullscreenApp() const; ScreenEdgeScrollMode getScreenEdgeScrollMode() const; - Bool getSendDelay(); Int getFirewallBehavior(); Short getFirewallPortAllocationDelta(); UnsignedShort getFirewallPortOverride(); diff --git a/Core/GameEngine/Include/GameNetwork/FirewallHelper.h b/Core/GameEngine/Include/GameNetwork/FirewallHelper.h index 352b1a040bc..3bef3a1db27 100644 --- a/Core/GameEngine/Include/GameNetwork/FirewallHelper.h +++ b/Core/GameEngine/Include/GameNetwork/FirewallHelper.h @@ -143,12 +143,6 @@ class FirewallHelperClass { */ FIREWALL_TYPE_SMART_MANGLING = 4, - /* - ** This is a firewall that exhibits the bug as seen in the Netgear firewalls. A previously good - ** source port mapping will change in response to unsolicited traffic from a known IP. - */ - FIREWALL_TYPE_NETGEAR_BUG = 8, - /* ** This firewall has a simple absolute offset port allocation scheme. */ @@ -225,20 +219,6 @@ class FirewallHelperClass { return(TRUE); }; - Bool isNetgear(FirewallBehaviorType behavior) { - if ((behavior & FIREWALL_TYPE_NETGEAR_BUG) != 0) { - return(TRUE); - } - return(FALSE); - }; - - Bool isNetgear() { - if ((m_behavior & FIREWALL_TYPE_NETGEAR_BUG) != 0) { - return(TRUE); - } - return(FALSE); - }; - private: diff --git a/Core/GameEngine/Include/GameNetwork/NAT.h b/Core/GameEngine/Include/GameNetwork/NAT.h index b5eb44c9596..7321e656391 100644 --- a/Core/GameEngine/Include/GameNetwork/NAT.h +++ b/Core/GameEngine/Include/GameNetwork/NAT.h @@ -47,7 +47,6 @@ enum NATStateType CPP_11(: Int) { enum NATConnectionState CPP_11(: Int) { NATCONNECTIONSTATE_NOSTATE, NATCONNECTIONSTATE_WAITINGTOBEGIN, -// NATCONNECTIONSTATE_NETGEARDELAY, NATCONNECTIONSTATE_WAITINGFORMANGLERRESPONSE, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT, NATCONNECTIONSTATE_WAITINGFORRESPONSE, diff --git a/Core/GameEngine/Source/Common/OptionPreferences.cpp b/Core/GameEngine/Source/Common/OptionPreferences.cpp index af61c4c84fe..e681ef8b192 100644 --- a/Core/GameEngine/Source/Common/OptionPreferences.cpp +++ b/Core/GameEngine/Source/Common/OptionPreferences.cpp @@ -451,18 +451,6 @@ Int OptionPreferences::getStaticGameDetail() return TheGameLODManager->getStaticGameLODIndex(it->second); } -Bool OptionPreferences::getSendDelay() -{ - OptionPreferences::const_iterator it = find("SendDelay"); - if (it == end()) - return TheGlobalData->m_firewallSendDelay; - - if (stricmp(it->second.str(), "yes") == 0) { - return TRUE; - } - return FALSE; -} - Int OptionPreferences::getFirewallBehavior() { OptionPreferences::const_iterator it = find("FirewallBehavior"); diff --git a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp index 04e5f7166b0..5698e3f47b0 100644 --- a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -626,12 +626,6 @@ Bool FirewallHelperClass::detectionBeginUpdate() { m_behavior = FIREWALL_TYPE_SIMPLE; DEBUG_LOG(("Source port %d specified by user", TheGlobalData->m_firewallPortOverride)); - if (TheGlobalData->m_firewallSendDelay) { - UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; - addbehavior |= (UnsignedInt)m_behavior; - m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("Netgear bug specified by command line or SendDelay flag")); - } m_currentState = DETECTIONSTATE_DONE; return TRUE; } @@ -714,20 +708,6 @@ Bool FirewallHelperClass::detectionBeginUpdate() { // memcpy(&(m_manglers[i]), &mangler_addresses[i][0], 4); } - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Testing for Netgear bug")); - - /* - ** See if the user specified a netgear firewall - that will save us the trouble. - */ - if (TheGlobalData->m_firewallSendDelay) { - UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; - addbehavior |= (UnsignedInt)m_behavior; - m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug specified by command line or SendDelay flag")); - } else { - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug not specified")); - } - /* ** OK, we have our manglers. ** @@ -1173,28 +1153,7 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { Bool FirewallHelperClass::detectionTest5Update() { /* ** We have done all the tests we *have* to. There's other info that it would be nice to know though. - ** - ** Test for the netgear bug behavior. */ -#if (0) -// moved to before test 1. Moved because this flag could be specified for another firewall -// for testing purposes and never get this far because it has behavior that doesn't require -// all the tests to be performed. -// BGC 10/1/02 - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Testing for Netgear bug")); - - /* - ** See if the user specified a netgear firewall - that will save us the trouble. - */ - if (TheGlobalData->m_firewallSendDelay) { - UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; - addbehavior |= (UnsignedInt)m_behavior; - m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug specified by command line or SendDelay flag")); - } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug not specified")); - } -#endif // #if (0) DEBUG_LOG_RAW(("FirewallHelperClass::detectionTest5Update - All done, behavior is: ")); @@ -1207,9 +1166,6 @@ Bool FirewallHelperClass::detectionTest5Update() { if ((m_behavior & FIREWALL_TYPE_SMART_MANGLING) != 0) { DEBUG_LOG_RAW((" FIREWALL_TYPE_SMART_MANGLING ")); } - if ((m_behavior & FIREWALL_TYPE_NETGEAR_BUG) != 0) { - DEBUG_LOG_RAW((" FIREWALL_TYPE_NETGEAR_BUG ")); - } if ((m_behavior & FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION) != 0) { DEBUG_LOG_RAW((" FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION ")); } @@ -1433,10 +1389,6 @@ Int FirewallHelperClass::getFirewallHardness(FirewallBehaviorType behavior) hardness += 3; } - if (((UnsignedInt)FIREWALL_TYPE_NETGEAR_BUG & fw) != 0) { - hardness += 10; - } - if (((UnsignedInt)FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION & fw) != 0) { hardness += 1; } @@ -1486,10 +1438,6 @@ Int FirewallHelperClass::getFirewallRetries(FirewallBehaviorType behavior) retries += 1; } - if (((UnsignedInt)FIREWALL_TYPE_NETGEAR_BUG & fw) != 0) { - //retries += 10; - } - if (((UnsignedInt)FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION & fw) != 0) { //retries += 1; } diff --git a/Core/GameEngine/Source/GameNetwork/NAT.cpp b/Core/GameEngine/Source/GameNetwork/NAT.cpp index 159d8532cfa..2fd839c0202 100644 --- a/Core/GameEngine/Source/GameNetwork/NAT.cpp +++ b/Core/GameEngine/Source/GameNetwork/NAT.cpp @@ -402,7 +402,7 @@ NATConnectionState NAT::connectionUpdate() { mangledPort = TheFirewallHelper->getManglerResponse(m_packetID); } if (mangledPort != 0) { - // we got a response. now we need to start probing (unless of course we have a netgear) + // we got a response. now we need to start probing processManglerResponse(mangledPort); // we know there is a firewall helper if we got here. @@ -497,50 +497,7 @@ void NAT::establishConnectionPaths() { m_previousSourcePort = 0; -// check for netgear bug behavior. -// as an aside, if there are more than 2 netgear bug firewall's in the game, -// it probably isn't going to work so well. stupid netgear. - -// nodes with a netgear bug behavior need to be matched up first. This prevents -// the NAT table from being reset for connections to other nodes. This also happens -// to be the reason why I call them "nodes" rather than "slots" or "players" as the -// ordering has to be messed with to get the netgears to make love, not war. DEBUG_LOG(("NAT::establishConnectionPaths - about to set up the node list")); - DEBUG_LOG(("NAT::establishConnectionPaths - doing the netgear stuff")); - UnsignedInt otherNetgearNum = -1; - for (i = 0; i < MAX_SLOTS; ++i) { - if ((m_slotList != nullptr) && (m_slotList[i] != nullptr)) { - if ((m_slotList[i]->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) { - if (otherNetgearNum == -1) { - // this is the start of a new pair, put it in as the first non -1 node connection pair thing. - Int nodeindex = 0; - while ((m_connectionPairs[m_connectionPairIndex][0][nodeindex] == -1) || (m_connectionNodes[nodeindex].m_slotIndex != -1)) { - ++nodeindex; - } - m_connectionNodes[nodeindex].m_slotIndex = i; - m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); - connectionAssigned[i] = TRUE; - otherNetgearNum = nodeindex; - DEBUG_LOG(("NAT::establishConnectionPaths - first netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); - } else { - // this is the second in the pair of netgears, pair this up with the other one - // for the first round. - Int nodeindex = 0; - while (m_connectionPairs[m_connectionPairIndex][0][nodeindex] != otherNetgearNum) { - ++nodeindex; - } - m_connectionNodes[nodeindex].m_slotIndex = i; - m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); - connectionAssigned[i] = TRUE; - otherNetgearNum = -1; - DEBUG_LOG(("NAT::establishConnectionPaths - second netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); - } - } - } - } - - // fill in the rest of the nodes with the remaining slots. - DEBUG_LOG(("NAT::establishConnectionPaths - doing the non-Netgear nodes")); for (i = 0; i < MAX_SLOTS; ++i) { if (connectionAssigned[i] == TRUE) { continue; @@ -662,6 +619,7 @@ void NAT::doThisConnectionRound() { if (i == m_localNodeNumber) { m_targetNodeNumber = targetNodeNumber; DEBUG_LOG(("NAT::doThisConnectionRound - Local node is connecting to node %d", m_targetNodeNumber)); +#if defined(DEBUG_LOGGING) UnsignedInt targetSlotIndex = m_connectionNodes[(m_connectionPairs[m_connectionPairIndex][m_connectionRound][i])].m_slotIndex; GameSlot *targetSlot = m_slotList[targetSlotIndex]; GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; @@ -671,24 +629,13 @@ void NAT::doThisConnectionRound() { DEBUG_LOG(("NAT::doThisConnectionRound - Target slot index = %d (%ls)", targetSlotIndex, m_slotList[targetSlotIndex]->getName().str())); DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has NAT behavior 0x%8X, local slot has NAT behavior 0x%8X", targetSlot->getNATBehavior(), localSlot->getNATBehavior())); -#if defined(DEBUG_LOGGING) UnsignedInt targetIP = targetSlot->getIP(); UnsignedInt localIP = localSlot->getIP(); -#endif DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has IP %d.%d.%d.%d Local slot has IP %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(targetIP), PRINTF_IP_AS_4_INTS(localIP))); - - if (((targetSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) == 0) && - ((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0)) { - - // we have a netgear bug type behavior and the target does not, so we need them to send to us - // first to avoid having our NAT table reset. - - DEBUG_LOG(("NAT::doThisConnectionRound - Local node has a netgear and the target node does not, need to delay our probe.")); - m_timeTillNextSend = -1; - } +#endif // figure out which port number I'm using for this connection // this merely starts to talk to the mangler server, we have to keep calling @@ -941,26 +888,6 @@ void NAT::probed(Int nodeNumber) { if (m_beenProbed == FALSE) { m_beenProbed = TRUE; DEBUG_LOG(("NAT::probed - just got probed for the first time.")); - if ((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) { - DEBUG_LOG(("NAT::probed - we have a NETGEAR and we were just probed for the first time")); - GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; - DEBUG_ASSERTCRASH(targetSlot != nullptr, ("NAT::probed - targetSlot is null")); - if (targetSlot == nullptr) { - DEBUG_LOG(("NAT::probed - targetSlot is null, failed this connection")); - setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); - return; - } - - if (targetSlot->getPort() == 0) { - setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT); - DEBUG_LOG(("NAT::probed - still waiting for mangled port")); - } else { - DEBUG_LOG(("NAT::probed - sending a probe to %ls", targetSlot->getName().str())); - sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); - notifyTargetOfProbe(targetSlot); - setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); - } - } } } @@ -996,20 +923,15 @@ void NAT::gotMangledPort(Int nodeNumber, UnsignedShort mangledPort) { targetSlot->setPort(mangledPort); DEBUG_LOG(("NAT::gotMangledPort - got mangled port number %d from our target node (%ls)", mangledPort, targetSlot->getName().str())); - if (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) == 0) || (m_beenProbed == TRUE) || - (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) && ((targetSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0))) { #ifdef DEBUG_LOGGING - UnsignedInt ip = targetSlot->getIP(); + UnsignedInt ip = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::gotMangledPort - don't have a netgear or we have already been probed, or both my target and I have a netgear, send a PROBE. Sending to %d.%d.%d.%d:%d", - PRINTF_IP_AS_4_INTS(ip), targetSlot->getPort())); + DEBUG_LOG(("NAT::gotMangledPort - send a PROBE. Sending to %d.%d.%d.%d:%d", + PRINTF_IP_AS_4_INTS(ip), targetSlot->getPort())); - sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); - notifyTargetOfProbe(targetSlot); - setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); - } else { - DEBUG_LOG(("NAT::gotMangledPort - we are a netgear, not sending a PROBE yet.")); - } + sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); + notifyTargetOfProbe(targetSlot); + setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); } void NAT::gotInternalAddress(Int nodeNumber, UnsignedInt address) { @@ -1171,8 +1093,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { DEBUG_LOG(("NAT::processGlobalMessage - got message from slot %d, message is \"%s\"", slotNum, ptr)); if (strncmp(ptr, "PROBED", strlen("PROBED")) == 0) { // format: PROBED - // a probe has been sent at us, if we are waiting because of a netgear or something, we - // should start sending our own probes. + // a probe has been sent at us; notify probed node. Int node = atoi(ptr + strlen("PROBED")); if (node == m_targetNodeNumber) { // make sure we're being probed by who we're supposed to be probed by. diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index 26023c229db..e631654250d 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -324,7 +324,6 @@ class GlobalData : public SubsystemInterface UnsignedInt m_defaultIP; ///< preferred IP address for LAN UnsignedInt m_firewallBehavior; ///< Last detected firewall behavior - Bool m_firewallSendDelay; ///< Use send delay for firewall connection negotiations UnsignedInt m_firewallPortOverride; ///< User-specified port to be used Short m_firewallPortAllocationDelta; ///< the port allocation delta last detected. diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 25d5432c51f..f7720c351a2 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -939,7 +939,6 @@ GlobalData::GlobalData() // m_languageFilterPref = false; m_languageFilterPref = true; m_firewallBehavior = FirewallHelperClass::FIREWALL_TYPE_UNKNOWN; - m_firewallSendDelay = FALSE; m_firewallPortOverride = 0; m_firewallPortAllocationDelta = 0; m_loadScreenDemo = FALSE; @@ -1205,7 +1204,6 @@ void GlobalData::parseGameDataDefinition( INI* ini ) TheWritableGlobalData->m_drawScrollAnchor = optionPref.getDrawScrollAnchor(); TheWritableGlobalData->m_moveScrollAnchor = optionPref.getMoveScrollAnchor(); TheWritableGlobalData->m_defaultIP = optionPref.getLANIPAddress(); - TheWritableGlobalData->m_firewallSendDelay = optionPref.getSendDelay(); TheWritableGlobalData->m_firewallBehavior = optionPref.getFirewallBehavior(); TheWritableGlobalData->m_firewallPortAllocationDelta = optionPref.getFirewallPortAllocationDelta(); TheWritableGlobalData->m_firewallPortOverride = optionPref.getFirewallPortOverride(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp index ddafc23e33e..d981cf37db0 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp @@ -124,8 +124,6 @@ void EstablishConnectionsMenu::setPlayerStatus(Int slot, NATConnectionState stat DEBUG_ASSERTCRASH(control != nullptr, ("player status control for slot %d is null", slot)); return; } -// if (state == NATCONNECTIONSTATE_NETGEARDELAY) { -// GadgetStaticTextSetText(control, TheGameText->fetch("GUI:NetgearDelay")); if (state == NATCONNECTIONSTATE_WAITINGFORMANGLERRESPONSE) { GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForManglerResponse")); } else if (state == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 91b7f80af92..b9e75b85c67 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -112,9 +112,6 @@ static GameWindow * checkUseCamera = nullptr; static NameKeyType checkSaveCameraID = NAMEKEY_INVALID; static GameWindow * checkSaveCamera = nullptr; -static NameKeyType checkSendDelayID = NAMEKEY_INVALID; -static GameWindow * checkSendDelay = nullptr; - static NameKeyType checkDrawAnchorID = NAMEKEY_INVALID; static GameWindow * checkDrawAnchor = nullptr; @@ -225,10 +222,6 @@ static void setDefaults() // language filter GadgetCheckBoxSetChecked( checkLanguageFilter, TRUE ); - //------------------------------------------------------------------------------------------------- - // send Delay - GadgetCheckBoxSetChecked(checkSendDelay, FALSE); - if constexpr (ModifyDisplaySettings) { //------------------------------------------------------------------------------------------------- @@ -389,18 +382,6 @@ static void saveOptions() (*pref)["LanguageFilter"] = "false"; } - //------------------------------------------------------------------------------------------------- - // send Delay - if (checkSendDelay && checkSendDelay->winGetEnabled()) - { - TheWritableGlobalData->m_firewallSendDelay = GadgetCheckBoxIsChecked(checkSendDelay); - if (TheGlobalData->m_firewallSendDelay) { - (*pref)["SendDelay"] = "yes"; - } else { - (*pref)["SendDelay"] = "no"; - } - } - //------------------------------------------------------------------------------------------------- // Custom game detail settings. GadgetComboBoxGetSelectedPos( comboBoxDetail, &index ); @@ -968,10 +949,16 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) checkLanguageFilterID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckLanguageFilter" ); checkLanguageFilter = TheWindowManager->winGetWindowFromId( nullptr, checkLanguageFilterID ); - checkSendDelayID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckSendDelay" ); - checkSendDelay = TheWindowManager->winGetWindowFromId( nullptr, checkSendDelayID); buttonFirewallRefreshID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:ButtonFirewallRefresh" ); buttonFirewallRefresh = TheWindowManager->winGetWindowFromId( nullptr, buttonFirewallRefreshID); + +#if ENABLE_GUI_HACKS + // TheSuperHackers @tweak 26/07/2026 Hide the obsolete Send Delay check box + GameWindow *checkSendDelay = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:CheckSendDelay")); + if (checkSendDelay) + checkSendDelay->winHide(TRUE); +#endif + checkDrawAnchorID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckBoxDrawAnchor" ); checkDrawAnchor = TheWindowManager->winGetWindowFromId( nullptr, checkDrawAnchorID); checkMoveAnchorID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckBoxMoveAnchor" ); @@ -1355,9 +1342,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } DEBUG_LOG(("Scroll Speed %d", scrollPos)); - // set the send delay check box - GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay); - // set volume sliders // set music volume slider @@ -1389,8 +1373,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) if (comboBoxOnlineIP) comboBoxOnlineIP->winEnable(FALSE); - checkSendDelay->winEnable(FALSE); - buttonFirewallRefresh->winEnable(FALSE); if (comboBoxDetail) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 5235b763fd1..7f484111672 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -325,7 +325,6 @@ class GlobalData : public SubsystemInterface UnsignedInt m_defaultIP; ///< preferred IP address for LAN UnsignedInt m_firewallBehavior; ///< Last detected firewall behavior - Bool m_firewallSendDelay; ///< Use send delay for firewall connection negotiations UnsignedInt m_firewallPortOverride; ///< User-specified port to be used Short m_firewallPortAllocationDelta; ///< the port allocation delta last detected. diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 131d20513ff..e862cd149d5 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -946,7 +946,6 @@ GlobalData::GlobalData() // m_languageFilterPref = false; m_languageFilterPref = true; m_firewallBehavior = FirewallHelperClass::FIREWALL_TYPE_UNKNOWN; - m_firewallSendDelay = FALSE; m_firewallPortOverride = 0; m_firewallPortAllocationDelta = 0; m_loadScreenDemo = FALSE; @@ -1212,7 +1211,6 @@ void GlobalData::parseGameDataDefinition( INI* ini ) TheWritableGlobalData->m_drawScrollAnchor = optionPref.getDrawScrollAnchor(); TheWritableGlobalData->m_moveScrollAnchor = optionPref.getMoveScrollAnchor(); TheWritableGlobalData->m_defaultIP = optionPref.getLANIPAddress(); - TheWritableGlobalData->m_firewallSendDelay = optionPref.getSendDelay(); TheWritableGlobalData->m_firewallBehavior = optionPref.getFirewallBehavior(); TheWritableGlobalData->m_firewallPortAllocationDelta = optionPref.getFirewallPortAllocationDelta(); TheWritableGlobalData->m_firewallPortOverride = optionPref.getFirewallPortOverride(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp index aace34b1c86..f9db5f45e14 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp @@ -124,8 +124,6 @@ void EstablishConnectionsMenu::setPlayerStatus(Int slot, NATConnectionState stat DEBUG_ASSERTCRASH(control != nullptr, ("player status control for slot %d is null", slot)); return; } -// if (state == NATCONNECTIONSTATE_NETGEARDELAY) { -// GadgetStaticTextSetText(control, TheGameText->fetch("GUI:NetgearDelay")); if (state == NATCONNECTIONSTATE_WAITINGFORMANGLERRESPONSE) { GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForManglerResponse")); } else if (state == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index ee99e20c452..44adecece05 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -118,9 +118,6 @@ static GameWindow * checkUseCamera = nullptr; static NameKeyType checkSaveCameraID = NAMEKEY_INVALID; static GameWindow * checkSaveCamera = nullptr; -static NameKeyType checkSendDelayID = NAMEKEY_INVALID; -static GameWindow * checkSendDelay = nullptr; - static NameKeyType checkDrawAnchorID = NAMEKEY_INVALID; static GameWindow * checkDrawAnchor = nullptr; @@ -234,10 +231,6 @@ static void setDefaults() // language filter GadgetCheckBoxSetChecked( checkLanguageFilter, TRUE ); - //------------------------------------------------------------------------------------------------- - // send Delay - GadgetCheckBoxSetChecked(checkSendDelay, FALSE); - if constexpr (ModifyDisplaySettings) { //------------------------------------------------------------------------------------------------- @@ -405,17 +398,6 @@ static void saveOptions() (*pref)["LanguageFilter"] = "false"; } - //------------------------------------------------------------------------------------------------- - // send Delay - if (checkSendDelay && checkSendDelay->winGetEnabled()) - { - TheWritableGlobalData->m_firewallSendDelay = GadgetCheckBoxIsChecked(checkSendDelay); - if (TheGlobalData->m_firewallSendDelay) { - (*pref)["SendDelay"] = "yes"; - } else { - (*pref)["SendDelay"] = "no"; - } - } //------------------------------------------------------------------------------------------------- // Custom game detail settings. @@ -997,10 +979,16 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) checkLanguageFilterID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckLanguageFilter" ); checkLanguageFilter = TheWindowManager->winGetWindowFromId( nullptr, checkLanguageFilterID ); - checkSendDelayID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckSendDelay" ); - checkSendDelay = TheWindowManager->winGetWindowFromId( nullptr, checkSendDelayID); buttonFirewallRefreshID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:ButtonFirewallRefresh" ); buttonFirewallRefresh = TheWindowManager->winGetWindowFromId( nullptr, buttonFirewallRefreshID); + +#if ENABLE_GUI_HACKS + // TheSuperHackers @tweak 26/07/2026 Hide the obsolete Send Delay check box + GameWindow *checkSendDelay = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:CheckSendDelay")); + if (checkSendDelay) + checkSendDelay->winHide(TRUE); +#endif + checkDrawAnchorID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckBoxDrawAnchor" ); checkDrawAnchor = TheWindowManager->winGetWindowFromId( nullptr, checkDrawAnchorID); checkMoveAnchorID = TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:CheckBoxMoveAnchor" ); @@ -1391,9 +1379,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } DEBUG_LOG(("Scroll Speed %d", scrollPos)); - // set the send delay check box - GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay); - // set volume sliders // set music volume slider @@ -1425,8 +1410,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) if (comboBoxOnlineIP) comboBoxOnlineIP->winEnable(FALSE); - checkSendDelay->winEnable(FALSE); - buttonFirewallRefresh->winEnable(FALSE); if (comboBoxDetail)