summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ProtocolRecognizer.h
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-09-04 17:58:38 +0200
committerAlexander Harkness <me@bearbin.net>2017-09-04 17:58:38 +0200
commit028a35ef0d4719e56a5bcc1a3f2a780128498f5d (patch)
tree67d5e9a4fdf9a89f59578b47149799b5b9550719 /src/Protocol/ProtocolRecognizer.h
parentGetPacketID for protocol packet IDs (#3977) (diff)
downloadcuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar.gz
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar.bz2
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar.lz
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar.xz
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.tar.zst
cuberite-028a35ef0d4719e56a5bcc1a3f2a780128498f5d.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/ProtocolRecognizer.h10
1 files changed, 7 insertions, 3 deletions
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();