From 2b5db5baf923a0c822e7ee048f218fd264e91f19 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 12 Nov 2014 16:56:14 +0300 Subject: Add missing packet field comments. --- src/net/tmwa/beinghandler.cpp | 11 ++++++++--- src/net/tmwa/beinghandler.h | 2 ++ src/net/tmwa/generalhandler.cpp | 2 +- src/net/tmwa/loginhandler.cpp | 2 +- src/net/tmwa/messagein.h | 6 +++--- src/net/tmwa/messageout.h | 6 +++--- 6 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index c85f4d78d..3c77e70a1 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -221,7 +221,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_SKILL_CAST_CANCEL: - msg.readInt32(); // id + processSkillCastCancel(msg); break; case SMSG_SKILL_NO_DAMAGE: @@ -1011,7 +1011,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) else spawnId = 0; mSpawnId = 0; - int16_t speed = msg.readInt16(); + int16_t speed = msg.readInt16("speed"); const uint16_t stunMode = msg.readInt16("opt1"); uint32_t statusEffects = msg.readInt16("opt2"); statusEffects |= (static_cast(msg.readInt16("option"))) << 16; @@ -1221,7 +1221,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) else spawnId = 0; mSpawnId = 0; - int16_t speed = msg.readInt16(); + int16_t speed = msg.readInt16("speed"); const uint16_t stunMode = msg.readInt16("opt1"); uint32_t statusEffects = msg.readInt16("opt2"); statusEffects |= (static_cast(msg.readInt16("option"))) << 16; @@ -1688,4 +1688,9 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) BLOCK_END("BeingHandler::processBeingSelfEffect") } +void BeingHandler::processSkillCastCancel(Net::MessageIn &msg A_UNUSED) +{ + msg.readInt32("skill id"); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index 0caaa9979..1ecc23d43 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -94,6 +94,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler const uint8_t type); static void processBeingSelfEffect(Net::MessageIn &msg); + + static void processSkillCastCancel(Net::MessageIn &msg); }; } // namespace TmwAthena diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 219cedc3d..0a81b764c 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -161,7 +161,7 @@ void GeneralHandler::handleMessage(Net::MessageIn &msg) void GeneralHandler::processConnectionProblem(Net::MessageIn &msg) { - const uint8_t code = msg.readUInt8(); + const uint8_t code = msg.readUInt8("flag"); logger->log("Connection problem: %u", static_cast(code)); switch (code) diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index ee0381475..2dbe22da8 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -184,7 +184,7 @@ ServerInfo *LoginHandler::getCharServer() const void LoginHandler::requestUpdateHosts() { createOutPacket(CMSG_SEND_CLIENT_INFO); - outMsg.writeInt8(CLIENT_PROTOCOL_VERSION); + outMsg.writeInt8(CLIENT_PROTOCOL_VERSION, "protocol version"); outMsg.writeInt8(0, "unused"); } diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h index 12e2b58cf..9326bfee2 100644 --- a/src/net/tmwa/messagein.h +++ b/src/net/tmwa/messagein.h @@ -48,11 +48,11 @@ class MessageIn final : public Net::MessageIn void postInit(); /**< Reads a short. */ - int16_t readInt16(const char *const str = nullptr); + int16_t readInt16(const char *const str); /**< Reads a long. */ - int32_t readInt32(const char *const str = nullptr); + int32_t readInt32(const char *const str); - int64_t readInt64(const char *const str = nullptr); + int64_t readInt64(const char *const str); uint16_t readId(); }; diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index 0825488d6..f24b845ee 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -50,11 +50,11 @@ class MessageOut final : public Net::MessageOut /**< Writes a short. */ void writeInt16(const int16_t value, - const char *const str = nullptr); + const char *const str); /**< Writes a long. */ void writeInt32(const int32_t value, - const char *const str = nullptr); + const char *const str); /** * Encodes coordinates and direction in 3 bytes. @@ -62,7 +62,7 @@ class MessageOut final : public Net::MessageOut void writeCoordinates(const uint16_t x, const uint16_t y, unsigned char direction, - const char *const str = nullptr); + const char *const str); void resetPos() { mPos = 0; } -- cgit v1.2.3-70-g09d2