From aebfbfb8c8d623ded8d409d29983a5e871a475bc Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Sat, 2 Sep 2017 11:46:57 -0500 Subject: GetPacketID for protocol packet IDs (#3977) * Added GetPacketId method to protocol, implemented for all protocols. * Moved GetPacketID methods into a single file, alpha-sorted. * Fixed 1.12.1 HandlePacket switch statement. * Added SendLogin to the GetPacketId framework. * Added SpawnObject to GetPacketId framework. * Added missing sendEntityEquipment packet ID update for 1.12.1 * Added LeashEntity packet ID change to 1.12.1 * Alphabetized packet enum, added SpawnGlobalEntity to GetPacketId framework * Fixed clang errors * Indented cases, expanded comment for GetPacketId * Changed dyslexic comment. --- src/Protocol/ProtocolRecognizer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Protocol/ProtocolRecognizer.h') diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h index 295c6db16..f96d5aa77 100644 --- a/src/Protocol/ProtocolRecognizer.h +++ b/src/Protocol/ProtocolRecognizer.h @@ -52,6 +52,9 @@ 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; -- cgit v1.2.3