summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-05 02:04:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:57 +0300
commit2a0b524403f62e0217cf52e88a0c7e4e62f88df9 (patch)
treecb0e40619e8cf7e08427ba68e5955ca5263ea184 /src/net/tmwa
parent2e6aa47dc0d372536985cec0e4d5ff7c9eb2bd18 (diff)
downloadplus-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.gz
plus-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.bz2
plus-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.tar.xz
plus-2a0b524403f62e0217cf52e88a0c7e4e62f88df9.zip
Move processWalkResponse from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/playerhandler.cpp17
-rw-r--r--src/net/tmwa/playerhandler.h2
2 files changed, 19 insertions, 0 deletions
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