diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-04 00:29:36 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-04 00:29:36 +0200 |
commit | 157f1c6688db8abe72c93a292f43d5a04040e0a4 (patch) | |
tree | 6bc75ef3703cd2cbbaeba3c6cb115fed87b62794 /src/Protocol/ProtocolRecognizer.cpp | |
parent | Anvil: switched inflate to stream mode. (diff) | |
download | cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar.gz cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar.bz2 cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar.lz cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar.xz cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.tar.zst cuberite-157f1c6688db8abe72c93a292f43d5a04040e0a4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/ProtocolRecognizer.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 8b395230a..642e96880 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -13,6 +13,7 @@ #include "Protocol15x.h" #include "Protocol16x.h" #include "Protocol17x.h" +#include "Protocol18x.h" #include "../ClientHandle.h" #include "../Root.h" #include "../Server.h" @@ -51,7 +52,7 @@ AString cProtocolRecognizer::GetVersionTextFromInt(int a_ProtocolVersion) { case PROTO_VERSION_1_2_5: return "1.2.5"; case PROTO_VERSION_1_3_2: return "1.3.2"; - case PROTO_VERSION_1_4_2: return "1.4.2"; + // case PROTO_VERSION_1_4_2: return "1.4.2"; case PROTO_VERSION_1_4_4: return "1.4.4"; case PROTO_VERSION_1_4_6: return "1.4.6"; case PROTO_VERSION_1_5_0: return "1.5"; @@ -62,6 +63,7 @@ AString cProtocolRecognizer::GetVersionTextFromInt(int a_ProtocolVersion) case PROTO_VERSION_1_6_4: return "1.6.4"; case PROTO_VERSION_1_7_2: return "1.7.2"; case PROTO_VERSION_1_7_6: return "1.7.6"; + case PROTO_VERSION_1_8_0: return "1.8"; } ASSERT(!"Unknown protocol version"); return Printf("Unknown protocol (%d)", a_ProtocolVersion); @@ -1016,6 +1018,27 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState); return true; } + case PROTO_VERSION_1_8_0: + { + AString ServerAddress; + short ServerPort; + UInt32 NextState; + if (!m_Buffer.ReadVarUTF8String(ServerAddress)) + { + break; + } + if (!m_Buffer.ReadBEShort(ServerPort)) + { + break; + } + if (!m_Buffer.ReadVarInt(NextState)) + { + break; + } + m_Buffer.CommitRead(); + m_Protocol = new cProtocol180(m_Client, ServerAddress, (UInt16)ServerPort, NextState); + return true; + } } LOGINFO("Client \"%s\" uses an unsupported protocol (lengthed, version %u)", m_Client->GetIPString().c_str(), ProtocolVersion |