summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 15:43:00 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 15:43:04 +0100
commit73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (patch)
treeea00f8e3ccbdb601bcac58f60d40ab1db1d2408a /src/gui
parentbf8a3fc881d17f44cdcfdf3639289bef09229c03 (diff)
downloadmana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.gz
mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.bz2
mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.xz
mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.zip
Added support for the "persistentIp" server info setting
This option was added in ManaPlus and support for it is required to connect to The Mana World as it is currently set up, since the server sends 127.0.0.1 for the character server and map server IP. Can't play yet, because of an unknown packet 0x226 being received once connecting to the map server.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/serverdialog.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 50510d15..3ea978e1 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -501,9 +501,18 @@ void ServerDialog::loadServers()
server.port = ServerInfo::defaultPortForServerType(server.type);
}
}
- else if (xmlStrEqual(subNode->name, BAD_CAST "description"))
+ else if (subNode->xmlChildrenNode && subNode->xmlChildrenNode->content)
{
- server.description = (const char*) subNode->xmlChildrenNode->content;
+ const char *text = (const char*) subNode->xmlChildrenNode->content;
+
+ if (xmlStrEqual(subNode->name, BAD_CAST "description"))
+ {
+ server.description = text;
+ }
+ else if (xmlStrEqual(subNode->name, BAD_CAST "persistentIp"))
+ {
+ server.persistentIp = strcmp(text, "1") == 0 || strcmp(text, "true") == 0;
+ }
}
}