diff options
author | madmaxoft <github@xoft.cz> | 2013-11-03 00:01:56 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-03 11:59:06 +0100 |
commit | cd52eeb22348bb503431f1955136f3d9fa5a2df2 (patch) | |
tree | b9cbd64bbd521ce69b1742b452a67a3b080374e4 /Tools | |
parent | ProtoProxy: Removed unused enums. (diff) | |
download | cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar.gz cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar.bz2 cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar.lz cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar.xz cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.tar.zst cuberite-cd52eeb22348bb503431f1955136f3d9fa5a2df2.zip |
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/ProtoProxy/Connection.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index ad5ae2930..627b42052 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -615,6 +615,15 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size) m_ServerBuffer.ResetRead(); break; } + if (PacketLen == 0) + { + m_ServerBuffer.ResetRead(); + AString All; + m_ServerBuffer.ReadAll(All); + DataLog(All.data(), All.size(), "====== Received a bad packet length? Inspect the contents below ======"); + m_ServerBuffer.CommitRead(); // Try to recover by marking everything as read + break; + } UInt32 PacketType, PacketReadSoFar; PacketReadSoFar = m_ServerBuffer.GetReadableSpace(); VERIFY(m_ServerBuffer.ReadVarInt(PacketType)); @@ -1891,6 +1900,7 @@ bool cConnection::HandleServerMapChunkBulk(void) // TODO: Save the compressed data into a file for later analysis COPY_TO_CLIENT(); + Sleep(50); return true; } @@ -2219,7 +2229,9 @@ bool cConnection::HandleServerSpawnObjectVehicle(void) m_ServerBuffer.ResetRead(); m_ServerBuffer.ReadAll(Buffer); m_ServerBuffer.ResetRead(); - m_ServerBuffer.SkipRead(1); + UInt32 PacketLen, PacketType; + m_ServerBuffer.ReadVarInt(PacketLen); + m_ServerBuffer.ReadVarInt(PacketType); if (Buffer.size() > 128) { // Only log up to 128 bytes |