From 15f4f0d6fecf4dc38ae1ec07c0abb04c20e22c1e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 31 Mar 2016 23:33:24 +0300 Subject: Set packet version based on packet id and current packet version into version in MessageIn. Only for hercules. --- src/net/eathena/messagein.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/net/eathena/messagein.cpp') diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp index 3a71e0c76..7b21b7485 100644 --- a/src/net/eathena/messagein.cpp +++ b/src/net/eathena/messagein.cpp @@ -40,12 +40,21 @@ MessageIn::MessageIn(const char *const data, { } -void MessageIn::postInit(const char *const str) +void MessageIn::postInit(const char *const str, + const unsigned int version) { // Read the message ID mId = readId(); + mVersion = version; IGNOREDEBUGLOG; DEBUGLOG2("Receive packet", 0, "MessageIn"); +#ifdef ENABLEDEBUGLOG + if (mVersion > 0) + { + const std::string verStr = toString(mVersion); + DEBUGLOG2("Version", 0, verStr.c_str()); + } +#endif readInt16(str); } -- cgit v1.2.3-70-g09d2