From e29749b35edcadc4724997ad6ab90eb44d77e906 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 16 Jan 2014 15:26:58 +0100 Subject: Added packet diagnostics to 1.7 protocol. When the packet is mis-interpreted, a log message is output about the packet type and lengths. --- src/Protocol/Protocol17x.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Protocol/Protocol17x.h') diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h index fd6b1fc0f..07dba834b 100644 --- a/src/Protocol/Protocol17x.h +++ b/src/Protocol/Protocol17x.h @@ -222,8 +222,10 @@ protected: /// Adds the received (unencrypted) data to m_ReceivedData, parses complete packets void AddReceivedData(const char * a_Data, int a_Size); - /// Reads and handles the packet. The packet length and type have already been read. - void HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType); + /** Reads and handles the packet. The packet length and type have already been read. + Returns true if the packet was understood, false if it was an unknown packet + */ + bool HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType); // Packet handlers while in the Status state (m_State == 1): void HandlePacketStatusPing (cByteBuffer & a_ByteBuffer); -- cgit v1.2.3