From 028a35ef0d4719e56a5bcc1a3f2a780128498f5d Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Mon, 4 Sep 2017 10:58:38 -0500 Subject: Added assert to cProtocolRecognizer::GetPacketId. (#4001) --- src/Protocol/ProtocolRecognizer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Protocol/ProtocolRecognizer.h') diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h index f96d5aa77..6d75b0f2e 100644 --- a/src/Protocol/ProtocolRecognizer.h +++ b/src/Protocol/ProtocolRecognizer.h @@ -52,9 +52,6 @@ public: /** Translates protocol version number into protocol version text: 49 -> "1.4.4" */ static AString GetVersionTextFromInt(int a_ProtocolVersion); - /** GetPacketId is implemented in each protocol version class */ - virtual UInt32 GetPacketId(eOutgoingPackets a_Packet) override { return 0; } - /** Called when client sends some data: */ virtual void DataReceived(const char * a_Data, size_t a_Size) override; @@ -159,6 +156,13 @@ protected: /** Is a server list ping for an unrecognized version currently occuring? */ bool m_InPingForUnrecognizedVersion; + /** GetPacketId is implemented in each protocol version class */ + virtual UInt32 GetPacketId(eOutgoingPackets a_Packet) override + { + ASSERT(!"cProtocolRecognizer::GetPacketId should never be called! Something is horribly wrong! (this method being called implies that someone other than a Protocol-derived class is calling GetPacketId)"); + return 0; + } + // Packet handlers while in status state (m_InPingForUnrecognizedVersion == true) void HandlePacketStatusRequest(); void HandlePacketStatusPing(); -- cgit v1.2.3