summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/messagein.cpp24
-rw-r--r--src/net/messagein.h10
2 files changed, 32 insertions, 2 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index d5888534e..ff34cd2c5 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -43,6 +43,9 @@ PRAGMA48(GCC diagnostic pop)
(CAST_U16(CAST_U8(high))) << 8))
extern int itemIdLen;
+extern int packetVersionMain;
+extern int packetVersionRe;
+extern int packetVersionZero;
namespace Net
{
@@ -474,4 +477,25 @@ unsigned char *MessageIn::readBytes(int length, const char *const dstr)
return buf;
}
+int MessageIn::getVersionMain() const noexcept2
+{
+ if (packetVersionMain >= mVersion)
+ return mVersion;
+ return 0;
+}
+
+int MessageIn::getVersionRe() const noexcept2
+{
+ if (packetVersionRe >= mVersion)
+ return mVersion;
+ return 0;
+}
+
+int MessageIn::getVersionZero() const noexcept2
+{
+ if (packetVersionZero >= mVersion)
+ return mVersion;
+ return 0;
+}
+
} // namespace Net
diff --git a/src/net/messagein.h b/src/net/messagein.h
index 255710349..155e2a6b8 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -130,9 +130,15 @@ class MessageIn notfinal
static uint8_t fromServerDirection(const uint8_t serverDir)
A_WARN_UNUSED;
- unsigned int getVersion() const noexcept2 A_WARN_UNUSED
+ int getVersion() const noexcept2 A_WARN_UNUSED
{ return mVersion; }
+ int getVersionMain() const noexcept2 A_WARN_UNUSED;
+
+ int getVersionRe() const noexcept2 A_WARN_UNUSED;
+
+ int getVersionZero() const noexcept2 A_WARN_UNUSED;
+
protected:
/**
* Constructor.
@@ -148,7 +154,7 @@ class MessageIn notfinal
* reading it.
*/
unsigned int mPos;
- unsigned int mVersion;
+ int mVersion;
uint16_t mId; /**< The message ID. */
bool mIgnore;
};