summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 0c7f9cb7e..212ce9d55 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -200,6 +200,17 @@ void MessageIn::skip(const unsigned int length, const char *const str)
PacketCounters::incInBytes(length);
}
+void MessageIn::skipToEnd(const char *const str)
+{
+ const int diff = static_cast<int>(mLength - mPos);
+ if (diff)
+ {
+ DEBUGLOG2("skip: " + toString(diff), mPos, str);
+ mPos = mLength;
+ PacketCounters::incInBytes(diff);
+ }
+}
+
std::string MessageIn::readString(int length, const char *const dstr)
{
// Get string length