summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-09-18 14:17:09 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-09-18 17:41:06 +0200
commit608e7a9950ccb423b9d715185a29f2fc035e6dc6 (patch)
tree2a9221475622b535383f6350a986b18dd3c86ddd /src
parentAdd State enum to protocol (diff)
downloadcuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar.gz
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar.bz2
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar.lz
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar.xz
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.tar.zst
cuberite-608e7a9950ccb423b9d715185a29f2fc035e6dc6.zip
Diffstat (limited to 'src')
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp30
-rw-r--r--src/Protocol/Protocol_1_8.cpp3
-rw-r--r--src/Protocol/Protocol_1_8.h2
-rw-r--r--src/Protocol/Protocol_1_9.cpp4
-rw-r--r--src/Protocol/Protocol_1_9.h2
5 files changed, 20 insertions, 21 deletions
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index ef273d9e6..521f9e247 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -287,21 +287,21 @@ std::unique_ptr<cProtocol> cMultiVersionProtocol::TryRecognizeLengthedProtocol(c
switch (static_cast<cProtocol::Version>(ProtocolVersion))
{
- case cProtocol::Version::v1_8_0: return std::make_unique<cProtocol_1_8_0> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_9_0: return std::make_unique<cProtocol_1_9_0> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_9_1: return std::make_unique<cProtocol_1_9_1> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_9_2: return std::make_unique<cProtocol_1_9_2> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_9_4: return std::make_unique<cProtocol_1_9_4> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_10_0: return std::make_unique<cProtocol_1_10_0>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_11_0: return std::make_unique<cProtocol_1_11_0>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_11_1: return std::make_unique<cProtocol_1_11_1>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_12: return std::make_unique<cProtocol_1_12> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_12_1: return std::make_unique<cProtocol_1_12_1>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_12_2: return std::make_unique<cProtocol_1_12_2>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_13: return std::make_unique<cProtocol_1_13> (&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_13_1: return std::make_unique<cProtocol_1_13_1>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_13_2: return std::make_unique<cProtocol_1_13_2>(&a_Client, ServerAddress, ServerPort, NextState);
- case cProtocol::Version::v1_14: return std::make_unique<cProtocol_1_14> (&a_Client, ServerAddress, ServerPort, NextState);
+ case cProtocol::Version::v1_8_0: return std::make_unique<cProtocol_1_8_0> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_9_0: return std::make_unique<cProtocol_1_9_0> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_9_1: return std::make_unique<cProtocol_1_9_1> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_9_2: return std::make_unique<cProtocol_1_9_2> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_9_4: return std::make_unique<cProtocol_1_9_4> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_10_0: return std::make_unique<cProtocol_1_10_0>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_11_0: return std::make_unique<cProtocol_1_11_0>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_11_1: return std::make_unique<cProtocol_1_11_1>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_12: return std::make_unique<cProtocol_1_12> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_12_1: return std::make_unique<cProtocol_1_12_1>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_12_2: return std::make_unique<cProtocol_1_12_2>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_13: return std::make_unique<cProtocol_1_13> (&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_13_1: return std::make_unique<cProtocol_1_13_1>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_13_2: return std::make_unique<cProtocol_1_13_2>(&a_Client, ServerAddress, NextState);
+ case cProtocol::Version::v1_14: return std::make_unique<cProtocol_1_14> (&a_Client, ServerAddress, NextState);
default:
{
LOGD("Client \"%s\" uses an unsupported protocol (lengthed, version %u (0x%x))",
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 1ccc24e90..1c98d83f3 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -100,10 +100,9 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_8_0:
-cProtocol_1_8_0::cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, State a_State) :
+cProtocol_1_8_0::cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, State a_State) :
Super(a_Client),
m_ServerAddress(a_ServerAddress),
- // Note: a_ServerPort is unused
m_State(a_State),
m_IsEncrypted(false)
{
diff --git a/src/Protocol/Protocol_1_8.h b/src/Protocol/Protocol_1_8.h
index 47e483941..ced7cf62a 100644
--- a/src/Protocol/Protocol_1_8.h
+++ b/src/Protocol/Protocol_1_8.h
@@ -31,7 +31,7 @@ class cProtocol_1_8_0:
public:
- cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, State a_State);
+ cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, State a_State);
/** Called when client sends some data: */
virtual void DataReceived(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size) override;
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index db0d4c17d..c170227b5 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -79,8 +79,8 @@ static const UInt32 OFF_HAND = 1;
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_9_0:
-cProtocol_1_9_0::cProtocol_1_9_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, State a_State) :
- Super(a_Client, a_ServerAddress, a_ServerPort, a_State),
+cProtocol_1_9_0::cProtocol_1_9_0(cClientHandle * a_Client, const AString & a_ServerAddress, State a_State) :
+ Super(a_Client, a_ServerAddress, a_State),
m_IsTeleportIdConfirmed(true),
m_OutstandingTeleportId(0)
{
diff --git a/src/Protocol/Protocol_1_9.h b/src/Protocol/Protocol_1_9.h
index a7bd12c0a..a180c8f5e 100644
--- a/src/Protocol/Protocol_1_9.h
+++ b/src/Protocol/Protocol_1_9.h
@@ -37,7 +37,7 @@ class cProtocol_1_9_0:
public:
- cProtocol_1_9_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, State a_State);
+ cProtocol_1_9_0(cClientHandle * a_Client, const AString & a_ServerAddress, State a_State);
/** Sending stuff to clients (alphabetically sorted): */
virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity & a_Vehicle) override;