summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorRawng <rawng.github@gmail.com>2015-06-07 18:52:06 -0400
committerAndrei Karas <akaras@inbox.ru>2015-06-08 02:01:05 +0300
commitbc25e36e89779538adfd395c8d937c1677c20900 (patch)
treed7163be47aeaf6ef7a8ceb578f31285c61be6b87 /src/net
parent38528c58a53036c2e5b978f87f72c1d5f0332a08 (diff)
downloadmanaplus-bc25e36e89779538adfd395c8d937c1677c20900.tar.gz
manaplus-bc25e36e89779538adfd395c8d937c1677c20900.tar.bz2
manaplus-bc25e36e89779538adfd395c8d937c1677c20900.tar.xz
manaplus-bc25e36e89779538adfd395c8d937c1677c20900.zip
Check usePersistentIP when switching map servers
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/charserverhandler.cpp10
-rw-r--r--src/net/tmwa/charserverhandler.cpp10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 63ca3f277..893be8f4f 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -478,7 +478,15 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
gh->setMap(msg.readString(16, "map name"));
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
- server.hostname = ipToString(msg.readInt32("host"));
+ if (config.getBoolValue("usePersistentIP") || settings.persistentIp)
+ {
+ msg.readInt32("host");
+ server.hostname = settings.serverName;
+ }
+ else
+ {
+ server.hostname = ipToString(msg.readInt32("host"));
+ }
server.port = msg.readInt16("port");
network->disconnect();
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 71c56e457..e27e2c125 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -450,7 +450,15 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
gh->setMap(msg.readString(16, "map name"));
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
- server.hostname = ipToString(msg.readInt32("ip address"));
+ if (config.getBoolValue("usePersistentIP") || settings.persistentIp)
+ {
+ msg.readInt32("ip address");
+ server.hostname = settings.serverName;
+ }
+ else
+ {
+ server.hostname = ipToString(msg.readInt32("ip address"));
+ }
server.port = msg.readInt16("port");
network->disconnect();