diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-05 02:04:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:57 +0300 |
commit | 2a0b524403f62e0217cf52e88a0c7e4e62f88df9 (patch) | |
tree | cb0e40619e8cf7e08427ba68e5955ca5263ea184 /src/net | |
parent | 2e6aa47dc0d372536985cec0e4d5ff7c9eb2bd18 (diff) | |
download | manaverse-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.gz manaverse-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.bz2 manaverse-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.xz manaverse-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.zip |
Move processWalkResponse from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/playerhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 17 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.h | 2 |
6 files changed, 37 insertions, 18 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 437f1fe27..e365ccdfe 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -99,22 +99,6 @@ Vector PlayerHandler::getDefaultWalkSpeed() const return Vector(150, 150, 0); } -void PlayerHandler::processWalkResponse(Net::MessageIn &msg) -{ - BLOCK_START("PlayerHandler::processWalkResponse") - /* - * This client assumes that all walk messages succeed, - * and that the server will send a correction notice - * otherwise. - */ - uint16_t srcX, srcY, dstX, dstY; - msg.readInt32(); // tick - msg.readCoordinatePair(srcX, srcY, dstX, dstY); - if (localPlayer) - localPlayer->setRealPos(dstX, dstY); - BLOCK_END("PlayerHandler::processWalkResponse") -} - void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) { BLOCK_START("PlayerHandler::processPlayerWarp") diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index d58930237..6669da9ff 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -57,8 +57,6 @@ class PlayerHandler notfinal : public Net::PlayerHandler int getAttackLocation() const override final A_WARN_UNUSED; - static void processWalkResponse(Net::MessageIn &msg); - static void processPlayerWarp(Net::MessageIn &msg); static void processPlayerStatUpdate1(Net::MessageIn &msg); diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index a4ce3c0d0..c6636fded 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -340,4 +340,20 @@ void PlayerHandler::processPlayerGetExp(Net::MessageIn &msg) // need show particle depend on isQuest flag, for now ignored } +void PlayerHandler::processWalkResponse(Net::MessageIn &msg) +{ + BLOCK_START("PlayerHandler::processWalkResponse") + /* + * This client assumes that all walk messages succeed, + * and that the server will send a correction notice + * otherwise. + */ + uint16_t srcX, srcY, dstX, dstY; + msg.readInt32(); // tick + msg.readCoordinatePair(srcX, srcY, dstX, dstY); + if (localPlayer) + localPlayer->setRealPos(dstX, dstY); + BLOCK_END("PlayerHandler::processWalkResponse") +} + } // namespace EAthena diff --git a/src/net/eathena/playerhandler.h b/src/net/eathena/playerhandler.h index 03806ec4d..cc6804164 100644 --- a/src/net/eathena/playerhandler.h +++ b/src/net/eathena/playerhandler.h @@ -64,6 +64,8 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler void processPlayerStatUpdate5(Net::MessageIn &msg); void processPlayerGetExp(Net::MessageIn &msg); + + static void processWalkResponse(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index a881f9dd4..3e304e8da 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -28,6 +28,7 @@ #include "being/attributes.h" #include "being/beingflag.h" +#include "being/localplayer.h" #include "gui/windows/statuswindow.h" @@ -413,4 +414,20 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg) BLOCK_END("PlayerHandler::processPlayerStatUpdate5") } +void PlayerHandler::processWalkResponse(Net::MessageIn &msg) +{ + BLOCK_START("PlayerHandler::processWalkResponse") + /* + * This client assumes that all walk messages succeed, + * and that the server will send a correction notice + * otherwise. + */ + uint16_t srcX, srcY, dstX, dstY; + msg.readInt32(); // tick + msg.readCoordinatePair(srcX, srcY, dstX, dstY); + if (localPlayer) + localPlayer->setRealPos(dstX, dstY); + BLOCK_END("PlayerHandler::processWalkResponse") +} + } // namespace TmwAthena diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index f70f59f58..a3e62ae10 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -62,6 +62,8 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler protected: void processPlayerStatUpdate5(Net::MessageIn &msg); + + static void processWalkResponse(Net::MessageIn &msg); }; } // namespace TmwAthena |