From 11d80e856811ceddec805ce68b0a17b13f5cf25e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Sep 2014 12:38:59 +0300 Subject: In debug packets logging also display offset. --- src/net/tmwa/messageout.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/net/tmwa/messageout.cpp') diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp index a740df563..a66c1c2b1 100644 --- a/src/net/tmwa/messageout.cpp +++ b/src/net/tmwa/messageout.cpp @@ -57,7 +57,8 @@ void MessageOut::expand(const size_t bytes) void MessageOut::writeInt16(const int16_t value, const char *const str) { - DEBUGLOG2("writeInt16: " + toStringPrint(static_cast(value)), str); + DEBUGLOG2("writeInt16: " + toStringPrint(static_cast(value)), + mPos, str); expand(2); #if SDL_BYTEORDER == SDL_BIG_ENDIAN int16_t swap = SDL_Swap16(value); @@ -71,7 +72,7 @@ void MessageOut::writeInt16(const int16_t value, const char *const str) 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); @@ -94,7 +95,7 @@ void MessageOut::writeCoordinates(const uint16_t x, { DEBUGLOG2(strprintf("writeCoordinates: %u,%u %u", static_cast(x), static_cast(y), - static_cast(direction)), str); + static_cast(direction)), mPos, str); unsigned char *const data = reinterpret_cast(mData) + static_cast(mPos); mNetwork->mOutSize += 3; -- cgit v1.2.3-60-g2f50