summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ProtocolRecognizer.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-21 13:00:20 +0100
committerMattes D <github@xoft.cz>2015-03-21 13:00:20 +0100
commitb1d4b3bb96629b3624e8328d7b1a0bce5333bb7d (patch)
tree2cb73fbb8e15ca8f65d794ddb9d9717cdd27f5ce /src/Protocol/ProtocolRecognizer.cpp
parentAPIDump: Added inheritance checking. (diff)
downloadcuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar.gz
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar.bz2
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar.lz
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar.xz
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.tar.zst
cuberite-b1d4b3bb96629b3624e8328d7b1a0bce5333bb7d.zip
Diffstat (limited to 'src/Protocol/ProtocolRecognizer.cpp')
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index af9e0d1bc..167a309a0 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -911,13 +911,13 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
case PROTO_VERSION_1_7_2:
{
AString ServerAddress;
- short ServerPort;
+ UInt16 ServerPort;
UInt32 NextState;
if (!m_Buffer.ReadVarUTF8String(ServerAddress))
{
break;
}
- if (!m_Buffer.ReadBEShort(ServerPort))
+ if (!m_Buffer.ReadBEUInt16(ServerPort))
{
break;
}
@@ -926,19 +926,19 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
break;
}
m_Buffer.CommitRead();
- m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
+ m_Protocol = new cProtocol172(m_Client, ServerAddress, ServerPort, NextState);
return true;
}
case PROTO_VERSION_1_7_6:
{
AString ServerAddress;
- short ServerPort;
+ UInt16 ServerPort;
UInt32 NextState;
if (!m_Buffer.ReadVarUTF8String(ServerAddress))
{
break;
}
- if (!m_Buffer.ReadBEShort(ServerPort))
+ if (!m_Buffer.ReadBEUInt16(ServerPort))
{
break;
}
@@ -947,19 +947,19 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
break;
}
m_Buffer.CommitRead();
- m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
+ m_Protocol = new cProtocol176(m_Client, ServerAddress, ServerPort, NextState);
return true;
}
case PROTO_VERSION_1_8_0:
{
AString ServerAddress;
- short ServerPort;
+ UInt16 ServerPort;
UInt32 NextState;
if (!m_Buffer.ReadVarUTF8String(ServerAddress))
{
break;
}
- if (!m_Buffer.ReadBEShort(ServerPort))
+ if (!m_Buffer.ReadBEUInt16(ServerPort))
{
break;
}
@@ -968,12 +968,12 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
break;
}
m_Buffer.CommitRead();
- m_Protocol = new cProtocol180(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
+ m_Protocol = new cProtocol180(m_Client, ServerAddress, ServerPort, NextState);
return true;
}
}
- LOGINFO("Client \"%s\" uses an unsupported protocol (lengthed, version %u)",
- m_Client->GetIPString().c_str(), ProtocolVersion
+ LOGINFO("Client \"%s\" uses an unsupported protocol (lengthed, version %u (0x%x))",
+ m_Client->GetIPString().c_str(), ProtocolVersion, ProtocolVersion
);
m_Client->Kick("Unsupported protocol version");
return false;