From 29f538f28efee4715d3a3f9cb4bc61cdbe4b7e97 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Thu, 23 Jul 2026 18:46:39 +0200 Subject: [PATCH 1/2] refactor(network): Remove obsolete HTTP Proxy option --- .../GameNetwork/GameSpy/MainMenuUtils.cpp | 9 ------ Core/Tools/PATCHGET/CHATAPI.cpp | 9 ------ .../GUI/GUICallbacks/Menus/OptionsMenu.cpp | 32 +++++-------------- .../GUI/GUICallbacks/Menus/OptionsMenu.cpp | 32 +++++-------------- 4 files changed, 16 insertions(+), 66 deletions(-) diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp index b74533d569f..f35a947ae0e 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp @@ -854,15 +854,6 @@ static void reallyStartPatchCheck() FormatURLFromRegistry(gameURL, mapURL, configURL, motdURL); - std::string proxy; - if (GetStringFromRegistry("", "Proxy", proxy)) - { - if (!proxy.empty()) - { - ghttpSetProxy(proxy.c_str()); - } - } - // check for a patch first DEBUG_LOG(("Game patch check: [%s]", gameURL.c_str())); DEBUG_LOG(("Map patch check: [%s]", mapURL.c_str())); diff --git a/Core/Tools/PATCHGET/CHATAPI.cpp b/Core/Tools/PATCHGET/CHATAPI.cpp index 7e1df70c117..5307a0e6feb 100644 --- a/Core/Tools/PATCHGET/CHATAPI.cpp +++ b/Core/Tools/PATCHGET/CHATAPI.cpp @@ -451,15 +451,6 @@ static void StartPatchCheck( void ) FormatURLFromRegistry(gameURL, mapURL, configURL, motdURL); - std::string proxy; - if (GetStringFromRegistry("", "Proxy", proxy)) - { - if (!proxy.empty()) - { - ghttpSetProxy(proxy.c_str()); - } - } - // check for a patch first checksLeft = 2; cantConnect = false; 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..e80b5e0f6ef 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -501,18 +501,6 @@ static void saveOptions() } } - //------------------------------------------------------------------------------------------------- - // HTTP Proxy - GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy")); - if (textEntryHTTPProxy && textEntryHTTPProxy->winGetEnabled()) - { - UnicodeString uStr = GadgetTextEntryGetText(textEntryHTTPProxy); - AsciiString aStr; - aStr.translate(uStr); - SetStringInRegistry("", "Proxy", aStr.str()); - ghttpSetProxy(aStr.str()); - } - //------------------------------------------------------------------------------------------------- // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride")); @@ -1125,16 +1113,15 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } } - // HTTP Proxy - GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy")); + NameKeyType textEntryHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:TextEntryHTTPProxy"); + GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, textEntryHTTPProxyID); if (textEntryHTTPProxy) - { - UnicodeString uStr; - std::string proxy; - GetStringFromRegistry("", "Proxy", proxy); - uStr.translate(proxy.c_str()); - GadgetTextEntrySetText(textEntryHTTPProxy, uStr); - } + textEntryHTTPProxy->winHide(TRUE); + + NameKeyType staticTextHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:StaticTextHTTPProxy"); + GameWindow *staticTextHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, staticTextHTTPProxyID); + if (staticTextHTTPProxy) + staticTextHTTPProxy->winHide(TRUE); // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride")); @@ -1402,9 +1389,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) if (textEntryFirewallPortOverride) textEntryFirewallPortOverride->winEnable(FALSE); - if (textEntryHTTPProxy) - textEntryHTTPProxy->winEnable(FALSE); - // if (checkAudioSurround) // checkAudioSurround->winEnable(FALSE); // 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..5e7afef81da 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -520,18 +520,6 @@ static void saveOptions() } } - //------------------------------------------------------------------------------------------------- - // HTTP Proxy - GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy")); - if (textEntryHTTPProxy && textEntryHTTPProxy->winGetEnabled()) - { - UnicodeString uStr = GadgetTextEntryGetText(textEntryHTTPProxy); - AsciiString aStr; - aStr.translate(uStr); - SetStringInRegistry("", "Proxy", aStr.str()); - ghttpSetProxy(aStr.str()); - } - //------------------------------------------------------------------------------------------------- // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride")); @@ -1157,16 +1145,15 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } } - // HTTP Proxy - GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy")); + NameKeyType textEntryHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:TextEntryHTTPProxy"); + GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, textEntryHTTPProxyID); if (textEntryHTTPProxy) - { - UnicodeString uStr; - std::string proxy; - GetStringFromRegistry("", "Proxy", proxy); - uStr.translate(proxy.c_str()); - GadgetTextEntrySetText(textEntryHTTPProxy, uStr); - } + textEntryHTTPProxy->winHide(TRUE); + + NameKeyType staticTextHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:StaticTextHTTPProxy"); + GameWindow *staticTextHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, staticTextHTTPProxyID); + if (staticTextHTTPProxy) + staticTextHTTPProxy->winHide(TRUE); // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride")); @@ -1438,9 +1425,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) if (textEntryFirewallPortOverride) textEntryFirewallPortOverride->winEnable(FALSE); - if (textEntryHTTPProxy) - textEntryHTTPProxy->winEnable(FALSE); - // if (checkAudioSurround) // checkAudioSurround->winEnable(FALSE); // From d23a40e42a2653fbba619ed7e2cb1639e6f7b707 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Sun, 26 Jul 2026 18:26:35 +0200 Subject: [PATCH 2/2] refactor(network): Put HTTP Proxy option hiding behind ENABLE_GUI_HACKS --- .../Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 3 +++ .../Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 3 +++ 2 files changed, 6 insertions(+) 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 e80b5e0f6ef..18d61931b93 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1113,6 +1113,8 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } } +#if ENABLE_GUI_HACKS + // TheSuperHackers @tweak 26/07/2026 Hide the obsolete HTTP Proxy entry and its label NameKeyType textEntryHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:TextEntryHTTPProxy"); GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, textEntryHTTPProxyID); if (textEntryHTTPProxy) @@ -1122,6 +1124,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) GameWindow *staticTextHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, staticTextHTTPProxyID); if (staticTextHTTPProxy) staticTextHTTPProxy->winHide(TRUE); +#endif // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride")); 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 5e7afef81da..bb7369ced9d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1145,6 +1145,8 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) } } +#if ENABLE_GUI_HACKS + // TheSuperHackers @tweak 26/07/2026 Hide the obsolete HTTP Proxy entry and its label NameKeyType textEntryHTTPProxyID = TheNameKeyGenerator->nameToKey("OptionsMenu.wnd:TextEntryHTTPProxy"); GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, textEntryHTTPProxyID); if (textEntryHTTPProxy) @@ -1154,6 +1156,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) GameWindow *staticTextHTTPProxy = TheWindowManager->winGetWindowFromId(nullptr, staticTextHTTPProxyID); if (staticTextHTTPProxy) staticTextHTTPProxy->winHide(TRUE); +#endif // Firewall Port Override GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride"));