summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ProtocolRecognizer.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2020-01-03 14:30:51 +0100
committerMattes D <github@xoft.cz>2020-01-07 06:53:17 +0100
commit583fd0a3870cdc2089f201b03631c8213da9f53b (patch)
tree8602df200baa25a6c6e64bc53aaccd3c78ce497c /src/Protocol/ProtocolRecognizer.h
parentRoot: Load the UpgradeBlockTypePalette on startup. (diff)
downloadcuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar.gz
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar.bz2
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar.lz
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar.xz
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.tar.zst
cuberite-583fd0a3870cdc2089f201b03631c8213da9f53b.zip
Diffstat (limited to 'src/Protocol/ProtocolRecognizer.h')
-rw-r--r--src/Protocol/ProtocolRecognizer.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index 185793f55..691de5e57 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -1,13 +1,3 @@
-
-// ProtocolRecognizer.h
-
-// Interfaces to the cProtocolRecognizer class representing the meta-protocol that recognizes possibly multiple
-// protocol versions and redirects everything to them
-
-
-
-
-
#pragma once
#include "Protocol.h"
@@ -26,7 +16,9 @@
-class cProtocolRecognizer :
+/** Meta-protocol that recognizes multiple protocol versions, creates the specific
+protocol version instance and redirects everything to it. */
+class cProtocolRecognizer:
public cProtocol
{
typedef cProtocol super;
@@ -49,7 +41,7 @@ public:
};
cProtocolRecognizer(cClientHandle * a_Client);
- virtual ~cProtocolRecognizer() override;
+ virtual ~cProtocolRecognizer() override {}
/** Translates protocol version number into protocol version text: 49 -> "1.4.4" */
static AString GetVersionTextFromInt(int a_ProtocolVersion);
@@ -149,9 +141,11 @@ public:
virtual void SendData(const char * a_Data, size_t a_Size) override;
+
protected:
+
/** The recognized protocol */
- cProtocol * m_Protocol;
+ std::unique_ptr<cProtocol> m_Protocol;
/** Buffer for the incoming data until we recognize the protocol */
cByteBuffer m_Buffer;