From 2a0b524403f62e0217cf52e88a0c7e4e62f88df9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Sep 2014 02:04:59 +0300 Subject: Move processWalkResponse from ea namespace into eathena and tmwa. --- src/net/tmwa/playerhandler.cpp | 17 +++++++++++++++++ src/net/tmwa/playerhandler.h | 2 ++ 2 files changed, 19 insertions(+) (limited to 'src/net/tmwa') 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 -- cgit v1.2.3-60-g2f50