Skip to content

refactor(network): Remove obsolete Online IP option - #3036

Open
githubawn wants to merge 1 commit into
TheSuperHackers:mainfrom
githubawn:refactor/remove-online-ip
Open

refactor(network): Remove obsolete Online IP option#3036
githubawn wants to merge 1 commit into
TheSuperHackers:mainfrom
githubawn:refactor/remove-online-ip

Conversation

@githubawn

Copy link
Copy Markdown

This PR removes the obsolete "Online IP:" dropdown (ComboBoxOnlineIP) and its associated GameSpyIPAddress preference key from the Options menu and preferences system.

In original 2003 Generals, GameSpy chat registration offered a separate dropdown ("Online IP:") allowing players to manually select an IP for GameSpy chat connections. Outbound sockets automatically use the system's default network routing table interface, making a secondary manual IP dropdown redundant.

Changes Made

  • Options Menu UI (OptionsMenu.cpp in Generals & GeneralsMD):
    • Hidden ComboBoxOnlineIP and StaticTextOnlineIP under #if ENABLE_GUI_HACKS with @tweak attribution matching recent options cleanup PRs.
    • Removed pref->setOnlineIPAddress() and pref->getOnlineIPAddress() populate and save logic.
  • Preferences (OptionPreferences.h / OptionPreferences.cpp):
    • Removed getOnlineIPAddress() and setOnlineIPAddress() methods.
    • Stopped writing the legacy GameSpyIPAddress key to Options.ini.
  • Peer Networking (PeerThread.cpp):
    • Updated GameSpy chat thread to bind dynamically using IPEnumeration without looking up static options preferences.
  • Direct Connect (NetworkDirectConnect.cpp in Generals & GeneralsMD):
    • Updated Direct Connect screen setup to use prefs.getLANIPAddress() as the single source of truth.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR removes the obsolete Online IP preference and UI while consolidating network-interface selection around current address enumeration and the LAN IP preference.

  • Removes the GameSpyIPAddress accessors and persistence path.
  • Hides the obsolete Online IP controls in both game targets.
  • Selects an enumerated local address for GameSpy chat.
  • Validates the stored LAN address and falls back to an available interface during Direct Connect initialization.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the current Direct Connect setup verifies the preferred LAN address against the enumerated interfaces and substitutes an available address when the stored selection is stale.

Important Files Changed

Filename Overview
Core/GameEngine/Include/Common/OptionPreferences.h Removes the obsolete Online IP preference API.
Core/GameEngine/Source/Common/OptionPreferences.cpp Removes lookup and persistence helpers for the legacy GameSpy IP preference.
Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp Replaces preference-based GameSpy chat binding with dynamic local-address enumeration.
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp Validates the configured LAN address against current interfaces and fixes the previously reported stale-address path.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp Mirrors the corrected Direct Connect address validation for Zero Hour.
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp Removes Online IP population and saving while hiding the obsolete controls.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp Mirrors removal of the obsolete Online IP controls and preference handling.

Reviews (2): Last reviewed commit: "refactor(network): remove Online IP opti..." | Re-trigger Greptile

@githubawn
githubawn force-pushed the refactor/remove-online-ip branch from d84c727 to a5b126a Compare July 31, 2026 12:24
@Skyaero42

Copy link
Copy Markdown

For my understanding, if I'm connected to radmin, I used to have two options - use my local IP (192.*) for a lan game or a Radmin IP (2-something) for a radmin game. Is this now automated? I can see game rooms from both networks?

Secondly, does this also require a wnd file to be edited?

@githubawn

githubawn commented Jul 31, 2026

Copy link
Copy Markdown
Author

It does require work on the .wnd file. This is properly gated behind ENABLE_GUI_HACKS.

In my original branch, I combined the entire networking refactor into a single commit. Here, you can see all games across all your networks: debug multi-instance, VMs, Radmin, and LAN.

However, without those follow-up PRs, the current approach will require returning to the main menu.

If that's unacceptable I have to pull in the rest of the networking refactor and expand the scope of this PR adding:
Automated multi-instance port mapping (allowing to stop forcing debug players to switch the lan ip).
Discovery subnet multiplexing and multi-interface broadcast handling.

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