diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-18 19:57:23 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-18 20:23:10 +0200 |
commit | 5141d05ba676df9584831ffa9ff6e8ff8905887d (patch) | |
tree | 34a516e598fb0aeece8d728ad8f978d3d00fd0d0 /src/Protocol/ProtocolRecognizer.cpp | |
parent | 1.13 items support (diff) | |
download | cuberite-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/ProtocolRecognizer.cpp')
-rw-r--r-- | src/Protocol/ProtocolRecognizer.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 0e93aa98f..6dc1c8bd8 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -58,22 +58,22 @@ cMultiVersionProtocol::cMultiVersionProtocol() : -AString cMultiVersionProtocol::GetVersionTextFromInt(int a_ProtocolVersion) +AString cMultiVersionProtocol::GetVersionTextFromInt(cProtocol::Version a_ProtocolVersion) { switch (a_ProtocolVersion) { - case PROTO_VERSION_1_8_0: return "1.8"; - case PROTO_VERSION_1_9_0: return "1.9"; - case PROTO_VERSION_1_9_1: return "1.9.1"; - case PROTO_VERSION_1_9_2: return "1.9.2"; - case PROTO_VERSION_1_9_4: return "1.9.4"; - case PROTO_VERSION_1_10_0: return "1.10"; - case PROTO_VERSION_1_11_0: return "1.11"; - case PROTO_VERSION_1_11_1: return "1.11.1"; - case PROTO_VERSION_1_12: return "1.12"; - case PROTO_VERSION_1_12_1: return "1.12.1"; - case PROTO_VERSION_1_12_2: return "1.12.2"; - case PROTO_VERSION_1_13: return "1.13"; + case cProtocol::Version::Version_1_8_0: return "1.8"; + case cProtocol::Version::Version_1_9_0: return "1.9"; + case cProtocol::Version::Version_1_9_1: return "1.9.1"; + case cProtocol::Version::Version_1_9_2: return "1.9.2"; + case cProtocol::Version::Version_1_9_4: return "1.9.4"; + case cProtocol::Version::Version_1_10_0: return "1.10"; + case cProtocol::Version::Version_1_11_0: return "1.11"; + case cProtocol::Version::Version_1_11_1: return "1.11.1"; + case cProtocol::Version::Version_1_12: return "1.12"; + case cProtocol::Version::Version_1_12_1: return "1.12.1"; + case cProtocol::Version::Version_1_12_2: return "1.12.2"; + case cProtocol::Version::Version_1_13: return "1.13"; } ASSERT(!"Unknown protocol version"); return Printf("Unknown protocol (%d)", a_ProtocolVersion); @@ -281,20 +281,20 @@ std::unique_ptr<cProtocol> cMultiVersionProtocol::TryRecognizeLengthedProtocol(c // All good, eat up the data: m_Buffer.CommitRead(); - switch (ProtocolVersion) + switch (static_cast<cProtocol::Version>(ProtocolVersion)) { - case PROTO_VERSION_1_8_0: return std::make_unique<cProtocol_1_8_0>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_9_0: return std::make_unique<cProtocol_1_9_0>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_9_1: return std::make_unique<cProtocol_1_9_1>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_9_2: return std::make_unique<cProtocol_1_9_2>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_9_4: return std::make_unique<cProtocol_1_9_4>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_10_0: return std::make_unique<cProtocol_1_10_0>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_11_0: return std::make_unique<cProtocol_1_11_0>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_11_1: return std::make_unique<cProtocol_1_11_1>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_12: return std::make_unique<cProtocol_1_12>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_12_1: return std::make_unique<cProtocol_1_12_1>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_12_2: return std::make_unique<cProtocol_1_12_2>(&a_Client, ServerAddress, ServerPort, NextState); - case PROTO_VERSION_1_13: return std::make_unique<cProtocol_1_13>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_8_0: return std::make_unique<cProtocol_1_8_0>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_9_0: return std::make_unique<cProtocol_1_9_0>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_9_1: return std::make_unique<cProtocol_1_9_1>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_9_2: return std::make_unique<cProtocol_1_9_2>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_9_4: return std::make_unique<cProtocol_1_9_4>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_10_0: return std::make_unique<cProtocol_1_10_0>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_11_0: return std::make_unique<cProtocol_1_11_0>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_11_1: return std::make_unique<cProtocol_1_11_1>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_12: return std::make_unique<cProtocol_1_12>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_12_1: return std::make_unique<cProtocol_1_12_1>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_12_2: return std::make_unique<cProtocol_1_12_2>(&a_Client, ServerAddress, ServerPort, NextState); + case cProtocol::Version::Version_1_13: return std::make_unique<cProtocol_1_13>(&a_Client, ServerAddress, ServerPort, NextState); default: { LOGD("Client \"%s\" uses an unsupported protocol (lengthed, version %u (0x%x))", |