summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-07-18 19:57:23 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-07-18 20:23:10 +0200
commit5141d05ba676df9584831ffa9ff6e8ff8905887d (patch)
tree34a516e598fb0aeece8d728ad8f978d3d00fd0d0 /src/Protocol/Protocol.h
parent1.13 items support (diff)
downloadcuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar.gz
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar.bz2
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar.lz
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar.xz
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.tar.zst
cuberite-5141d05ba676df9584831ffa9ff6e8ff8905887d.zip
Diffstat (limited to 'src/Protocol/Protocol.h')
-rw-r--r--src/Protocol/Protocol.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 61d098601..96e837bb0 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -326,6 +326,22 @@ public:
Pose
};
+ enum class Version
+ {
+ Version_1_8_0 = 47,
+ Version_1_9_0 = 107,
+ Version_1_9_1 = 108,
+ Version_1_9_2 = 109,
+ Version_1_9_4 = 110,
+ Version_1_10_0 = 210,
+ Version_1_11_0 = 315,
+ Version_1_11_1 = 316,
+ Version_1_12 = 335,
+ Version_1_12_1 = 338,
+ Version_1_12_2 = 340,
+ Version_1_13 = 393
+ };
+
/** Called when client sends some data */
virtual void DataReceived(const char * a_Data, size_t a_Size) = 0;
@@ -438,6 +454,9 @@ protected:
/** Returns the protocol-specific packet ID given the protocol-agnostic packet enum. */
virtual UInt32 GetPacketID(ePacketType a_Packet) = 0;
+ /** Returns the current protocol's version, for handling status requests. */
+ virtual Version GetProtocolVersion() = 0;
+
/** A generic data-sending routine, all outgoing packet data needs to be routed through this so that descendants may override it. */
virtual void SendData(const char * a_Data, size_t a_Size) = 0;