diff options
Diffstat (limited to 'src/net/eathena/charserverrecv.cpp')
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index c591e2ebd..28805f51d 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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) { |