summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-16 20:39:59 +0100
committermadmaxoft <github@xoft.cz>2014-01-16 20:39:59 +0100
commita0853194552107ab6e841a73e0ef1627ee76b72a (patch)
treeec6077320ab0c4a530cd066585fd80f00bf5bf53 /src/Protocol
parentDisabled excessive entity-related logging in Debug mode. (diff)
downloadcuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar.gz
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar.bz2
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar.lz
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar.xz
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.tar.zst
cuberite-a0853194552107ab6e841a73e0ef1627ee76b72a.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol17x.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 162194bc6..3c870a814 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1039,7 +1039,20 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size)
if (!HandlePacket(bb, PacketType))
{
- // Unknown packet, already been reported, just bail out
+ // Unknown packet, already been reported, but without the length. Log the length here:
+ LOGWARNING("Unhandled packet: type 0x%x, length %u", PacketType, PacketLen);
+
+ #ifdef _DEBUG
+ // Dump the packet contents into the log:
+ bb.ResetRead();
+ AString Packet;
+ bb.ReadAll(Packet);
+ Packet.resize(Packet.size() - 1); // Drop the final NUL pushed there for over-read detection
+ AString Out;
+ CreateHexDump(Out, Packet.data(), (int)Packet.size(), 24);
+ LOGD("Packet contents:\n%s", Out.c_str());
+ #endif // _DEBUG
+
return;
}