From bc25e36e89779538adfd395c8d937c1677c20900 Mon Sep 17 00:00:00 2001 From: Rawng Date: Sun, 7 Jun 2015 18:52:06 -0400 Subject: Check usePersistentIP when switching map servers --- src/net/tmwa/charserverhandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/net/tmwa') 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(); -- cgit v1.2.3-70-g09d2