summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-31 13:53:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-31 13:53:06 +0300
commita63248380554067d4291c653b4ba82db36fbc821 (patch)
treec4ad257d15fc44179ccafe9c3e887bfce710967c /src/net/eathena
parent1d5aa3c38c3a545ad0056613f561ac01d945b2ed (diff)
downloadmanaplus-a63248380554067d4291c653b4ba82db36fbc821.tar.gz
manaplus-a63248380554067d4291c653b4ba82db36fbc821.tar.bz2
manaplus-a63248380554067d4291c653b4ba82db36fbc821.tar.xz
manaplus-a63248380554067d4291c653b4ba82db36fbc821.zip
Add comments for inbound packet fields in debug log.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/messagein.cpp8
-rw-r--r--src/net/eathena/messagein.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index 6e542b698..f9d17bfd5 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -46,7 +46,7 @@ void MessageIn::postInit()
mId = readInt16();
}
-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/eathena/messagein.h b/src/net/eathena/messagein.h
index ad7fd7663..3c267a888 100644
--- a/src/net/eathena/messagein.h
+++ b/src/net/eathena/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 EAthena