diff options
Diffstat (limited to 'src/net/eathena/charserverrecv.cpp')
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index c591e2ebd..b5e2d5235 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -273,15 +273,13 @@ void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) BLOCK_START("CharServerRecv::processCharMapInfo") PlayerInfo::setCharId(msg.readInt32("char id")); GameHandler::setMap(msg.readString(16, "map name")); + + const int mapIpAddress = msg.readInt32("map ip address"); if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("map ip address"); server.hostname = settings.serverName; - } else - { - server.hostname = ipToString(msg.readInt32("map ip address")); - } + server.hostname = ipToString(mapIpAddress); + server.port = msg.readInt16("map ip port"); if (msg.getVersion() >= 20170329) { @@ -320,15 +318,12 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) GameHandler::setMap(msg.readString(16, "map name")); const int x = msg.readInt16("x"); const int y = msg.readInt16("y"); + const int mapIpAddress = msg.readInt32("map ip address"); if (config.getBoolValue("usePersistentIP") || settings.persistentIp) - { - msg.readInt32("host"); server.hostname = settings.serverName; - } else - { - server.hostname = ipToString(msg.readInt32("host")); - } + server.hostname = ipToString(mapIpAddress); + server.port = msg.readInt16("port"); if (msg.getVersion() >= 20170315) { |