summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorPersson-dev <sim16.prib@gmail.com>2022-04-21 13:27:45 +0200
committerAlexander Harkness <me@bearbin.net>2022-04-21 20:57:55 +0200
commit9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06 (patch)
tree8b0c8a04cfcf089bf8491f427a6eac03216f2c11 /src/Protocol
parentImplement farmland trampling (#5401) (diff)
downloadcuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar.gz
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar.bz2
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar.lz
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar.xz
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.tar.zst
cuberite-9c42d09ff890fb5f6f5eeab0714b0ed7ce515d06.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/ChunkDataSerializer.cpp4
-rw-r--r--src/Protocol/Protocol.h6
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp9
-rw-r--r--src/Protocol/Protocol_1_14.cpp48
-rw-r--r--src/Protocol/Protocol_1_14.h72
5 files changed, 138 insertions, 1 deletions
diff --git a/src/Protocol/ChunkDataSerializer.cpp b/src/Protocol/ChunkDataSerializer.cpp
index 4d4b98374..a6620da04 100644
--- a/src/Protocol/ChunkDataSerializer.cpp
+++ b/src/Protocol/ChunkDataSerializer.cpp
@@ -109,6 +109,10 @@ void cChunkDataSerializer::SendToClients(const int a_ChunkX, const int a_ChunkZ,
continue;
}
case cProtocol::Version::v1_14:
+ case cProtocol::Version::v1_14_1:
+ case cProtocol::Version::v1_14_2:
+ case cProtocol::Version::v1_14_3:
+ case cProtocol::Version::v1_14_4:
{
Serialize(Client, a_ChunkX, a_ChunkZ, a_BlockData, a_LightData, a_BiomeMap, CacheVersion::v477);
continue;
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 6b6a3b1d8..6bec7d944 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -346,7 +346,11 @@ public:
v1_13 = 393,
v1_13_1 = 401,
v1_13_2 = 404, // TODO: this constant should be in WebServer
- v1_14 = 477
+ v1_14 = 477,
+ v1_14_1 = 480,
+ v1_14_2 = 485,
+ v1_14_3 = 490,
+ v1_14_4 = 498
};
enum State
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 9062eb9b5..7dbfbda8c 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -66,6 +66,10 @@ AString cMultiVersionProtocol::GetVersionTextFromInt(cProtocol::Version a_Protoc
case cProtocol::Version::v1_13_1: return "1.13.1";
case cProtocol::Version::v1_13_2: return "1.13.2";
case cProtocol::Version::v1_14: return "1.14";
+ case cProtocol::Version::v1_14_1: return "1.14.1";
+ case cProtocol::Version::v1_14_2: return "1.14.2";
+ case cProtocol::Version::v1_14_3: return "1.14.3";
+ case cProtocol::Version::v1_14_4: return "1.14.4";
}
ASSERT(!"Unknown protocol version");
@@ -338,6 +342,11 @@ std::unique_ptr<cProtocol> cMultiVersionProtocol::TryRecognizeLengthedProtocol(c
case static_cast<UInt32>(cProtocol::Version::v1_13_1): return std::make_unique<cProtocol_1_13_1>(&a_Client, ServerAddress, NextState);
case static_cast<UInt32>(cProtocol::Version::v1_13_2): return std::make_unique<cProtocol_1_13_2>(&a_Client, ServerAddress, NextState);
case static_cast<UInt32>(cProtocol::Version::v1_14): return std::make_unique<cProtocol_1_14> (&a_Client, ServerAddress, NextState);
+ case static_cast<UInt32>(cProtocol::Version::v1_14_1): return std::make_unique<cProtocol_1_14_1>(&a_Client, ServerAddress, NextState);
+ case static_cast<UInt32>(cProtocol::Version::v1_14_2): return std::make_unique<cProtocol_1_14_2>(&a_Client, ServerAddress, NextState);
+ case static_cast<UInt32>(cProtocol::Version::v1_14_3): return std::make_unique<cProtocol_1_14_3>(&a_Client, ServerAddress, NextState);
+ case static_cast<UInt32>(cProtocol::Version::v1_14_4): return std::make_unique<cProtocol_1_14_4>(&a_Client, ServerAddress, NextState);
+
default:
{
LOGD("Client \"%s\" uses an unsupported protocol (lengthed, version %u (0x%x))",
diff --git a/src/Protocol/Protocol_1_14.cpp b/src/Protocol/Protocol_1_14.cpp
index 159bd7757..97be8175c 100644
--- a/src/Protocol/Protocol_1_14.cpp
+++ b/src/Protocol/Protocol_1_14.cpp
@@ -1662,3 +1662,51 @@ void cProtocol_1_14::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mo
default: UNREACHABLE("cProtocol_1_14::WriteMobMetadata: received mob of invalid type");
} // switch (a_Mob.GetType())
}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// cProtocol_1_14_1:
+
+cProtocol::Version cProtocol_1_14_1::GetProtocolVersion() const
+{
+ return Version::v1_14_1;
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// cProtocol_1_14_2:
+
+cProtocol::Version cProtocol_1_14_2::GetProtocolVersion() const
+{
+ return Version::v1_14_2;
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// cProtocol_1_14_3:
+
+cProtocol::Version cProtocol_1_14_3::GetProtocolVersion() const
+{
+ return Version::v1_14_3;
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// cProtocol_1_14_4:
+
+cProtocol::Version cProtocol_1_14_4::GetProtocolVersion() const
+{
+ return Version::v1_14_4;
+}
diff --git a/src/Protocol/Protocol_1_14.h b/src/Protocol/Protocol_1_14.h
index a5813819b..81cd03166 100644
--- a/src/Protocol/Protocol_1_14.h
+++ b/src/Protocol/Protocol_1_14.h
@@ -67,3 +67,75 @@ protected:
virtual void WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity) const override;
virtual void WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) const override;
};
+
+
+
+
+
+class cProtocol_1_14_1:
+ public cProtocol_1_14
+{
+ using Super = cProtocol_1_14;
+
+public:
+
+ using Super::Super;
+
+protected:
+
+ virtual Version GetProtocolVersion() const override;
+};
+
+
+
+
+
+class cProtocol_1_14_2:
+ public cProtocol_1_14_1
+{
+ using Super = cProtocol_1_14_1;
+
+public:
+
+ using Super::Super;
+
+protected:
+
+ virtual Version GetProtocolVersion() const override;
+};
+
+
+
+
+
+class cProtocol_1_14_3:
+ public cProtocol_1_14_2
+{
+ using Super = cProtocol_1_14_2;
+
+public:
+
+ using Super::Super;
+
+protected:
+
+ virtual Version GetProtocolVersion() const override;
+};
+
+
+
+
+
+class cProtocol_1_14_4:
+ public cProtocol_1_14_3
+{
+ using Super = cProtocol_1_14_3;
+
+public:
+
+ using Super::Super;
+
+protected:
+
+ virtual Version GetProtocolVersion() const override;
+};