summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-25 15:06:21 +0100
committermadmaxoft <github@xoft.cz>2014-01-25 15:06:30 +0100
commit96b4af15963ac70b25ab243d84d48221a3d41369 (patch)
treece0a69c40f9d3a9a4187978c4a8b75e73a0460ff /src/Protocol
parentIgnoring the Comm Logs. (diff)
downloadcuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar.gz
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar.bz2
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar.lz
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar.xz
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.tar.zst
cuberite-96b4af15963ac70b25ab243d84d48221a3d41369.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index d2d0df7f7..8abe4f259 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1090,10 +1090,23 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size)
#ifdef _DEBUG
if (g_ShouldLogComm)
{
+ if (m_ReceivedData.GetReadableSpace() > 0)
+ {
+ AString AllData;
+ int OldReadableSpace = m_ReceivedData.GetReadableSpace();
+ m_ReceivedData.ReadAll(AllData);
+ m_ReceivedData.ResetRead();
+ m_ReceivedData.SkipRead(m_ReceivedData.GetReadableSpace() - OldReadableSpace);
+ AString Hex;
+ CreateHexDump(Hex, AllData.data(), AllData.size(), 16);
+ m_CommLogFile.Printf("Incoming data, %d (0x%x) bytes unparsed already present in buffer:\n%s\n",
+ AllData.size(), AllData.size(), Hex.c_str()
+ );
+ }
AString Hex;
CreateHexDump(Hex, a_Data, a_Size, 16);
- m_CommLogFile.Printf("Incoming data: %d bytes. %d bytes unparsed already present in buffer.\n%s\n",
- a_Size, m_ReceivedData.GetReadableSpace(), Hex.c_str()
+ m_CommLogFile.Printf("Incoming data: %d (0x%x) bytes: \n%s\n",
+ a_Size, a_Size, Hex.c_str()
);
}
#endif