summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/messagein.cpp10
-rw-r--r--src/net/tmwa/messagein.h6
2 files changed, 9 insertions, 7 deletions
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index 0e855ef56..18686f347 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -43,10 +43,10 @@ MessageIn::MessageIn(const char *const data, const unsigned int length) :
void MessageIn::postInit()
{
// Read the message ID
- mId = readInt16();
+ mId = readInt16("packet id");
}
-int16_t MessageIn::readInt16()
+int16_t MessageIn::readInt16(const char *const str)
{
int16_t value = -1;
if (mPos + 2 <= mLength)
@@ -61,11 +61,11 @@ int16_t MessageIn::readInt16()
}
mPos += 2;
PacketCounters::incInBytes(2);
- DEBUGLOG("readInt16: " + toStringPrint(static_cast<int>(value)));
+ DEBUGLOG2("readInt16: " + toStringPrint(static_cast<int>(value)), str);
return value;
}
-int32_t MessageIn::readInt32()
+int32_t MessageIn::readInt32(const char *const str)
{
int32_t value = -1;
if (mPos + 4 <= mLength)
@@ -80,7 +80,7 @@ int32_t MessageIn::readInt32()
}
mPos += 4;
PacketCounters::incInBytes(4);
- DEBUGLOG("readInt32: " + toStringPrint(value));
+ DEBUGLOG2("readInt32: " + toStringPrint(value), str);
return value;
}
diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h
index 8dd95a478..26ce4612c 100644
--- a/src/net/tmwa/messagein.h
+++ b/src/net/tmwa/messagein.h
@@ -47,8 +47,10 @@ class MessageIn final : public Net::MessageIn
void postInit();
- int16_t readInt16(); /**< Reads a short. */
- int32_t readInt32(); /**< Reads a long. */
+ /**< Reads a short. */
+ int16_t readInt16(const char *const str = nullptr);
+ /**< Reads a long. */
+ int32_t readInt32(const char *const str = nullptr);
};
} // namespace TmwAthena