summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ProtocolRecognizer.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-16 14:31:02 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-16 14:31:02 +0200
commit5a9acb7eb6eef293dc53cfe916c74f5cfa069db4 (patch)
tree8e0b29c5f0240ac0961e69b905921243130d0258 /src/Protocol/ProtocolRecognizer.cpp
parentFixed merge conflict (diff)
parentAttempted fix for the client crash with the new protocols. (diff)
downloadcuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.gz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.bz2
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.lz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.xz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.zst
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.zip
Diffstat (limited to 'src/Protocol/ProtocolRecognizer.cpp')
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 3f7d7b254..8a97b9713 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -59,6 +59,7 @@ AString cProtocolRecognizer::GetVersionTextFromInt(int a_ProtocolVersion)
case PROTO_VERSION_1_6_3: return "1.6.3";
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";
}
ASSERT(!"Unknown protocol version");
return Printf("Unknown protocol (%d)", a_ProtocolVersion);
@@ -396,6 +397,16 @@ void cProtocolRecognizer::SendLogin(const cPlayer & a_Player, const cWorld & a_W
+void cProtocolRecognizer::SendLoginSuccess(void)
+{
+ ASSERT(m_Protocol != NULL);
+ m_Protocol->SendLoginSuccess();
+}
+
+
+
+
+
void cProtocolRecognizer::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length)
{
ASSERT(m_Protocol != NULL);
@@ -965,6 +976,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
return true;
}
+ case PROTO_VERSION_1_7_6:
+ {
+ AString ServerAddress;
+ short ServerPort;
+ UInt32 NextState;
+ m_Buffer.ReadVarUTF8String(ServerAddress);
+ m_Buffer.ReadBEShort(ServerPort);
+ m_Buffer.ReadVarInt(NextState);
+ m_Buffer.CommitRead();
+ m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
+ return true;
+ }
}
LOGINFO("Client \"%s\" uses an unsupported protocol (lengthed, version %u)",
m_Client->GetIPString().c_str(), ProtocolVersion