summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ProtocolRecognizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/ProtocolRecognizer.cpp')
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp52
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))",