summaryrefslogtreecommitdiff
path: root/src/net/eathena/messageout.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-01 12:38:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:54 +0300
commit11d80e856811ceddec805ce68b0a17b13f5cf25e (patch)
tree31e4c919f5acd2e20b5f805bbe8524b1d0f9f754 /src/net/eathena/messageout.cpp
parenta15146e08d00f9986edfde7a15a70790b64cc1ce (diff)
downloadmanaverse-11d80e856811ceddec805ce68b0a17b13f5cf25e.tar.gz
manaverse-11d80e856811ceddec805ce68b0a17b13f5cf25e.tar.bz2
manaverse-11d80e856811ceddec805ce68b0a17b13f5cf25e.tar.xz
manaverse-11d80e856811ceddec805ce68b0a17b13f5cf25e.zip
In debug packets logging also display offset.
Diffstat (limited to 'src/net/eathena/messageout.cpp')
-rw-r--r--src/net/eathena/messageout.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 7c5d328cb..1b0dae6f1 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -57,7 +57,6 @@ void MessageOut::expand(const size_t bytes)
void MessageOut::writeInt16(const int16_t value, const char *const str)
{
- DEBUGLOG2("writeInt16: " + toStringPrint(static_cast<int>(value)), str);
expand(2);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int16_t swap = SDL_Swap16(value);
@@ -65,13 +64,15 @@ void MessageOut::writeInt16(const int16_t value, const char *const str)
#else
memcpy(mData + static_cast<size_t>(mPos), &value, sizeof(int16_t));
#endif
+ DEBUGLOG2("writeInt16: " + toStringPrint(static_cast<int>(value)),
+ mPos, str);
mPos += 2;
PacketCounters::incOutBytes(2);
}
void MessageOut::writeInt32(const int32_t value, const char *const str)
{
- DEBUGLOG2("writeInt32: " + toStringPrint(value), str);
+ DEBUGLOG2("writeInt32: " + toStringPrint(value), mPos, str);
expand(4);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int32_t swap = SDL_Swap32(value);
@@ -95,7 +96,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
DEBUGLOG2(strprintf("writeCoordinates: %u,%u %u",
static_cast<unsigned>(x),
static_cast<unsigned>(y),
- static_cast<unsigned>(direction)), str);
+ static_cast<unsigned>(direction)), mPos, str);
unsigned char *const data = reinterpret_cast<unsigned char*>(mData)
+ static_cast<size_t>(mPos);
mNetwork->mOutSize += 3;