summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/ea/charserverhandler.cpp28
-rw-r--r--src/net/ea/charserverhandler.h5
-rw-r--r--src/net/eathena/charserverhandler.cpp29
-rw-r--r--src/net/eathena/charserverhandler.h4
-rw-r--r--src/net/tmwa/charserverhandler.cpp29
-rw-r--r--src/net/tmwa/charserverhandler.h4
6 files changed, 62 insertions, 37 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index 90b1cfba9..b7ec866f5 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -248,32 +248,4 @@ void CharServerHandler::clear()
mCharacters.clear();
}
-void CharServerHandler::processChangeMapServer(Net::MessageIn &restrict msg,
- Network *restrict const network,
- ServerInfo &restrict server)
- const
-{
- BLOCK_START("CharServerHandler::processChangeMapServer")
- GameHandler *const gh = static_cast<GameHandler*>(Net::getGameHandler());
- if (!gh || !network)
- {
- BLOCK_END("CharServerHandler::processChangeMapServer")
- return;
- }
- gh->setMap(msg.readString(16));
- const int x = msg.readInt16();
- const int y = msg.readInt16();
- server.hostname = ipToString(msg.readInt32());
- server.port = msg.readInt16();
-
- network->disconnect();
- client->setState(STATE_CHANGE_MAP);
- if (localPlayer)
- {
- localPlayer->setTileCoords(x, y);
- localPlayer->setMap(nullptr);
- }
- BLOCK_END("CharServerHandler::processChangeMapServer")
-}
-
} // namespace Ea
diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h
index ebafea22c..42e9b73fe 100644
--- a/src/net/ea/charserverhandler.h
+++ b/src/net/ea/charserverhandler.h
@@ -76,11 +76,6 @@ class CharServerHandler notfinal : public Net::CharServerHandler
virtual void processCharDeleteFailed(Net::MessageIn &msg);
- virtual void processChangeMapServer(Net::MessageIn &restrict msg,
- Network *restrict const network,
- ServerInfo &restrict mapServer)
- const;
-
virtual void clear() override final;
protected:
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index d46728fac..5b3ccf79c 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -111,7 +111,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
break;
case SMSG_CHANGE_MAP_SERVER:
- processChangeMapServer(msg, mNetwork, mapServer);
+ processChangeMapServer(msg);
break;
default:
@@ -335,4 +335,31 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg)
BLOCK_END("CharServerHandler::processCharMapInfo")
}
+void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
+{
+ Network *const network = mNetwork;
+ ServerInfo &server = mapServer;
+ BLOCK_START("CharServerHandler::processChangeMapServer")
+ GameHandler *const gh = static_cast<GameHandler*>(Net::getGameHandler());
+ if (!gh || !network)
+ {
+ BLOCK_END("CharServerHandler::processChangeMapServer")
+ return;
+ }
+ gh->setMap(msg.readString(16));
+ const int x = msg.readInt16();
+ const int y = msg.readInt16();
+ server.hostname = ipToString(msg.readInt32());
+ server.port = msg.readInt16();
+
+ network->disconnect();
+ client->setState(STATE_CHANGE_MAP);
+ if (localPlayer)
+ {
+ localPlayer->setTileCoords(x, y);
+ localPlayer->setMap(nullptr);
+ }
+ BLOCK_END("CharServerHandler::processChangeMapServer")
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h
index e5618ab35..6da7e32fe 100644
--- a/src/net/eathena/charserverhandler.h
+++ b/src/net/eathena/charserverhandler.h
@@ -59,7 +59,9 @@ class CharServerHandler final : public MessageHandler,
void processCharLogin(Net::MessageIn &msg);
- void processCharMapInfo(Net::MessageIn &restrict msg);
+ void processCharMapInfo(Net::MessageIn &msg);
+
+ void processChangeMapServer(Net::MessageIn &msg);
protected:
void readPlayerData(Net::MessageIn &msg,
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index b8bdf4842..ae64dbf60 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -113,7 +113,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
break;
case SMSG_CHANGE_MAP_SERVER:
- processChangeMapServer(msg, mNetwork, mapServer);
+ processChangeMapServer(msg);
break;
default:
@@ -387,4 +387,31 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg)
BLOCK_END("CharServerHandler::processCharMapInfo")
}
+void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
+{
+ Network *const network = mNetwork;
+ ServerInfo &server = mapServer;
+ BLOCK_START("CharServerHandler::processChangeMapServer")
+ GameHandler *const gh = static_cast<GameHandler*>(Net::getGameHandler());
+ if (!gh || !network)
+ {
+ BLOCK_END("CharServerHandler::processChangeMapServer")
+ return;
+ }
+ gh->setMap(msg.readString(16));
+ const int x = msg.readInt16();
+ const int y = msg.readInt16();
+ server.hostname = ipToString(msg.readInt32());
+ server.port = msg.readInt16();
+
+ network->disconnect();
+ client->setState(STATE_CHANGE_MAP);
+ if (localPlayer)
+ {
+ localPlayer->setTileCoords(x, y);
+ localPlayer->setMap(nullptr);
+ }
+ BLOCK_END("CharServerHandler::processChangeMapServer")
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 8910b784c..062360800 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -59,7 +59,9 @@ class CharServerHandler final : public MessageHandler,
void processCharLogin(Net::MessageIn &msg);
- void processCharMapInfo(Net::MessageIn &restrict msg);
+ void processCharMapInfo(Net::MessageIn &msg);
+
+ void processChangeMapServer(Net::MessageIn &msg);
protected:
void readPlayerData(Net::MessageIn &msg,