summaryrefslogtreecommitdiff
path: root/src/net/tmwa/charserverrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/charserverrecv.cpp')
-rw-r--r--src/net/tmwa/charserverrecv.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp
index 6b8cf27c6..8f80deec4 100644
--- a/src/net/tmwa/charserverrecv.cpp
+++ b/src/net/tmwa/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
@@ -207,15 +207,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 ipAddress = 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.hostname = ipToString(ipAddress);
+
server.port = msg.readInt16("port");
server.althostname = charServer.althostname;
@@ -247,15 +245,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 ipAddress = 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.hostname = ipToString(ipAddress);
+
server.port = msg.readInt16("port");
network->disconnect();