Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Core/GameEngine/Include/Common/OptionPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ class OptionPreferences : public UserPreferences
TextureFilterClass::TextureFilterMode getTextureFilterMode() const;
TextureFilterClass::AnisotropicFilterMode getTextureAnisotropyLevel() const;
UnsignedInt getLANIPAddress();
UnsignedInt getOnlineIPAddress();
void setLANIPAddress(AsciiString IP);
void setOnlineIPAddress(AsciiString IP);
void setLANIPAddress(UnsignedInt IP);
void setOnlineIPAddress(UnsignedInt IP);
Bool getArchiveReplaysEnabled() const;
Bool getAlternateMouseModeEnabled();
Bool getRightMouseScrollWithAlternateMouseEnabled() const;
Expand Down
28 changes: 0 additions & 28 deletions Core/GameEngine/Source/Common/OptionPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,34 +152,6 @@ void OptionPreferences::setLANIPAddress(UnsignedInt IP)
(*this)["IPAddress"] = tmp;
}

UnsignedInt OptionPreferences::getOnlineIPAddress()
{
AsciiString selectedIP = (*this)["GameSpyIPAddress"];
IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();
while (IPlist)
{
if (selectedIP.compareNoCase(IPlist->getIPstring()) == 0)
{
return IPlist->getIP();
}
IPlist = IPlist->getNext();
}
return TheGlobalData->m_defaultIP;
}

void OptionPreferences::setOnlineIPAddress(AsciiString IP)
{
(*this)["GameSpyIPAddress"] = IP;
}

void OptionPreferences::setOnlineIPAddress(UnsignedInt IP)
{
AsciiString tmp;
tmp.format("%d.%d.%d.%d", PRINTF_IP_AS_4_INTS(IP));
(*this)["GameSpyIPAddress"] = tmp;
}

Bool OptionPreferences::getArchiveReplaysEnabled() const
{
OptionPreferences::const_iterator it = find("ArchiveReplays");
Expand Down
14 changes: 3 additions & 11 deletions Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,20 +1328,12 @@ void PeerThreadClass::Thread_Function()

OptionPreferences pref;
UnsignedInt preferredIP = INADDR_ANY;
UnsignedInt selectedIP = pref.getOnlineIPAddress();
DEBUG_LOG(("Looking for IP %X", selectedIP));
IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();
while (IPlist)
if (IPlist)
{
DEBUG_LOG(("Looking at IP %s", IPlist->getIPstring().str()));
if (selectedIP == IPlist->getIP())
{
preferredIP = IPlist->getIP();
DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X", preferredIP));
break;
}
IPlist = IPlist->getNext();
preferredIP = IPlist->getIP();
DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X", preferredIP));
}
chatSetLocalIP(preferredIP);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,35 +304,27 @@ void NetworkDirectConnectInit( WindowLayout *layout, void *userData )
TheLAN = NEW LANAPI();

OptionPreferences prefs;
UnsignedInt IP = prefs.getOnlineIPAddress();
UnsignedInt IP = prefs.getLANIPAddress();

IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();

// if (!IP)
// {
EnumeratedIP *IPlist = IPs.getAddresses();
DEBUG_ASSERTCRASH(IPlist, ("No IP addresses found!"));
if (!IPlist)
Bool foundIP = FALSE;
EnumeratedIP *tempIP = IPlist;
while (tempIP != nullptr && !foundIP)
{
if (IP == tempIP->getIP())
{
/// @todo: display error and exit lan lobby if no IPs are found
}

Bool foundIP = FALSE;
EnumeratedIP *tempIP = IPlist;
while ((tempIP != nullptr) && (foundIP == FALSE)) {
if (IP == tempIP->getIP()) {
foundIP = TRUE;
}
tempIP = tempIP->getNext();
foundIP = TRUE;
}
tempIP = tempIP->getNext();
}

if (foundIP == FALSE) {
// The IP that we had no longer exists, we need to pick a new one.
IP = IPlist->getIP();
}
if (!foundIP && IPlist != nullptr)
{
IP = IPlist->getIP();
}

// IP = IPlist->getIP();
// }
TheLAN->init();
TheLAN->SetLocalIP(IP);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,6 @@ static void saveOptions()
}
}

if (comboBoxOnlineIP && comboBoxOnlineIP->winGetEnabled())
{
UnsignedInt ip;
GadgetComboBoxGetSelectedPos(comboBoxOnlineIP, &index);
if (index>=0)
{
ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxOnlineIP, index);
pref->setOnlineIPAddress(ip);
}
}

//-------------------------------------------------------------------------------------------------
// Firewall Port Override
Expand Down Expand Up @@ -1064,42 +1054,17 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
}
}

// And now the GameSpy one
#if ENABLE_GUI_HACKS
// TheSuperHackers @tweak 31/07/2026 Manual Online IP selection was obsoleted because
// match sockets automatically use the system's default network routing table interface.
// Hide the obsoleted UI elements accordingly.
if (comboBoxOnlineIP)
{
UnsignedInt selectedIP = pref->getOnlineIPAddress();
UnicodeString str;
IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();
Int index;
Int selectedIndex = -1;
Int count = 0;
GadgetComboBoxReset(comboBoxOnlineIP);
while (IPlist)
{
count++;
str.translate(IPlist->getIPstring());
index = GadgetComboBoxAddEntry(comboBoxOnlineIP, str, color);
GadgetComboBoxSetItemData(comboBoxOnlineIP, index, (void *)(IPlist->getIP()));
if (selectedIP == IPlist->getIP())
{
selectedIndex = index;
}
IPlist = IPlist->getNext();
}
if (selectedIndex >= 0)
{
GadgetComboBoxSetSelectedPos(comboBoxOnlineIP, selectedIndex);
}
else
{
GadgetComboBoxSetSelectedPos(comboBoxOnlineIP, 0);
if (IPs.getAddresses())
{
pref->setOnlineIPAddress(IPs.getAddresses()->getIPstring());
}
}
}
comboBoxOnlineIP->winHide(TRUE);

GameWindow *staticTextOnlineIP = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:StaticTextOnlineIP"));
if (staticTextOnlineIP)
staticTextOnlineIP->winHide(TRUE);
#endif

#if ENABLE_GUI_HACKS
// TheSuperHackers @tweak 26/07/2026 The http proxy feature was obsoleted because it did nothing for the UDP game traffic or match sockets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,35 +304,27 @@ void NetworkDirectConnectInit( WindowLayout *layout, void *userData )
TheLAN = NEW LANAPI();

OptionPreferences prefs;
UnsignedInt IP = prefs.getOnlineIPAddress();
UnsignedInt IP = prefs.getLANIPAddress();

IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();

// if (!IP)
// {
EnumeratedIP *IPlist = IPs.getAddresses();
DEBUG_ASSERTCRASH(IPlist, ("No IP addresses found!"));
if (!IPlist)
Bool foundIP = FALSE;
EnumeratedIP *tempIP = IPlist;
while (tempIP != nullptr && !foundIP)
{
if (IP == tempIP->getIP())
{
/// @todo: display error and exit lan lobby if no IPs are found
}

Bool foundIP = FALSE;
EnumeratedIP *tempIP = IPlist;
while ((tempIP != nullptr) && (foundIP == FALSE)) {
if (IP == tempIP->getIP()) {
foundIP = TRUE;
}
tempIP = tempIP->getNext();
foundIP = TRUE;
}
tempIP = tempIP->getNext();
}

if (foundIP == FALSE) {
// The IP that we had no longer exists, we need to pick a new one.
IP = IPlist->getIP();
}
if (!foundIP && IPlist != nullptr)
{
IP = IPlist->getIP();
}

// IP = IPlist->getIP();
// }
TheLAN->init();
TheLAN->SetLocalIP(IP);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,17 +491,6 @@ static void saveOptions()
}
}

if (comboBoxOnlineIP && comboBoxOnlineIP->winGetEnabled())
{
UnsignedInt ip;
GadgetComboBoxGetSelectedPos(comboBoxOnlineIP, &index);
if (index>=0)
{
ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxOnlineIP, index);
pref->setOnlineIPAddress(ip);
}
}

//-------------------------------------------------------------------------------------------------
// Firewall Port Override
GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride"));
Expand Down Expand Up @@ -1097,42 +1086,17 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
}
}

// And now the GameSpy one
#if ENABLE_GUI_HACKS
// TheSuperHackers @tweak 31/07/2026 Manual Online IP selection was obsoleted because
// match sockets automatically use the system's default network routing table interface.
// Hide the obsoleted UI elements accordingly.
if (comboBoxOnlineIP)
{
UnsignedInt selectedIP = pref->getOnlineIPAddress();
UnicodeString str;
IPEnumeration IPs;
EnumeratedIP *IPlist = IPs.getAddresses();
Int index;
Int selectedIndex = -1;
Int count = 0;
GadgetComboBoxReset(comboBoxOnlineIP);
while (IPlist)
{
count++;
str.translate(IPlist->getIPstring());
index = GadgetComboBoxAddEntry(comboBoxOnlineIP, str, color);
GadgetComboBoxSetItemData(comboBoxOnlineIP, index, (void *)(IPlist->getIP()));
if (selectedIP == IPlist->getIP())
{
selectedIndex = index;
}
IPlist = IPlist->getNext();
}
if (selectedIndex >= 0)
{
GadgetComboBoxSetSelectedPos(comboBoxOnlineIP, selectedIndex);
}
else
{
GadgetComboBoxSetSelectedPos(comboBoxOnlineIP, 0);
if (IPs.getAddresses())
{
pref->setOnlineIPAddress(IPs.getAddresses()->getIPstring());
}
}
}
comboBoxOnlineIP->winHide(TRUE);

GameWindow *staticTextOnlineIP = TheWindowManager->winGetWindowFromId(nullptr, NAMEKEY("OptionsMenu.wnd:StaticTextOnlineIP"));
if (staticTextOnlineIP)
staticTextOnlineIP->winHide(TRUE);
#endif

#if ENABLE_GUI_HACKS
// TheSuperHackers @tweak 26/07/2026 The http proxy feature was obsoleted because it did nothing for the UDP game traffic or match sockets.
Expand Down
Loading