From 99e4225269776d4e79b7d0d14dc8bbe11a2ad32d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 15 Apr 2014 23:40:06 +0200 Subject: Attempted fix for the client crash with the new protocols. --- src/Protocol/Protocol17x.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index c8105c03a..aae87f994 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -538,6 +538,13 @@ void cProtocol172::SendInventorySlot(char a_WindowID, short a_SlotNum, const cIt void cProtocol172::SendKeepAlive(int a_PingID) { + // Drop the packet if the protocol is not in the Game state yet (caused a client crash): + if (m_State != 3) + { + LOGWARNING("Trying to send a KeepAlive packet to a player who's not yet fully logged in (%d). The protocol class prevented the packet.", m_State); + return; + } + cPacketizer Pkt(*this, 0x00); // Keep Alive packet Pkt.WriteInt(a_PingID); } -- cgit v1.2.3