diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-27 19:29:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-27 19:29:52 +0300 |
commit | 8333597dfaecfca2cac6b98390a8fb7131cb2a09 (patch) | |
tree | ff24e87dc5be6b2880b1cf25d5a03f2e926ce844 /src/net/messagein.cpp | |
parent | 3f0292bc97dec0c1c6a3c8997fb55012c4135480 (diff) | |
download | mv-8333597dfaecfca2cac6b98390a8fb7131cb2a09.tar.gz mv-8333597dfaecfca2cac6b98390a8fb7131cb2a09.tar.bz2 mv-8333597dfaecfca2cac6b98390a8fb7131cb2a09.tar.xz mv-8333597dfaecfca2cac6b98390a8fb7131cb2a09.zip |
Add support for logging bytes from packets.
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r-- | src/net/messagein.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 4fb61dc6a..8a51667db 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -262,6 +262,21 @@ char *MessageIn::readBytes(int length) buf[length + 1] = 0; mPos += length; +#ifdef ENABLEDEBUGLOG + std::string str; + for (int f = 0;f < length; f ++) + str += strprintf ("%02x", buf[f]); + str += " "; + for (int f = 0;f < length; f ++) + { + if (buf[f]) + str += strprintf ("%c", buf[f]); + else + str += "_"; + } + logger->log("ReadBytes: " + str); +#endif + PacketCounters::incInBytes(length); return buf; } |