summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp10
-rw-r--r--src/net/tmwa/loginhandler.cpp5
2 files changed, 13 insertions, 2 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index e500f667b..4bf9df8b3 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -160,7 +160,15 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
PlayerInfo::setCharId(msg.readInt32());
GameHandler *gh = static_cast<GameHandler*>(Net::getGameHandler());
gh->setMap(msg.readString(16));
- mapServer.hostname = ipToString(msg.readInt32());
+ if (config.getBoolValue("usePersistentIP"))
+ {
+ msg.readInt32();
+ mapServer.hostname = Client::getServerName();
+ }
+ else
+ {
+ mapServer.hostname = ipToString(msg.readInt32());
+ }
mapServer.port = msg.readInt16();
// Prevent the selected local player from being deleted
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 73fec1322..05a28513c 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -288,7 +288,10 @@ void LoginHandler::chooseServer(unsigned int server)
return;
charServer.clear();
- charServer.hostname = ipToString(mWorlds[server]->address);
+ if (config.getBoolValue("usePersistentIP"))
+ charServer.hostname = Client::getServerName();
+ else
+ charServer.hostname = ipToString(mWorlds[server]->address);
charServer.port = mWorlds[server]->port;
Client::setState(STATE_UPDATE);