diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-30 11:07:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-30 16:37:02 +0300 |
commit | e46cf607a4da55fc77b6b2ea7fca53d69ec6e56b (patch) | |
tree | e829744b50cab41c5f72c2a99a1fef971c2b9077 /src/net/eathena | |
parent | 3bea3e2804fbec4c7697d29af46c6330b1ca9b92 (diff) | |
download | mv-e46cf607a4da55fc77b6b2ea7fca53d69ec6e56b.tar.gz mv-e46cf607a4da55fc77b6b2ea7fca53d69ec6e56b.tar.bz2 mv-e46cf607a4da55fc77b6b2ea7fca53d69ec6e56b.tar.xz mv-e46cf607a4da55fc77b6b2ea7fca53d69ec6e56b.zip |
Remove additional parameters from processCharMapServer function.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 29 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.h | 4 |
2 files changed, 31 insertions, 2 deletions
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, |