diff options
author | Mattes D <github@xoft.cz> | 2015-03-22 23:09:23 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-22 23:09:23 +0100 |
commit | b913c5da69f362abbb70de6e11baca4cbce2b919 (patch) | |
tree | 782854bd86c7165e38459e592fb81979270f732a /Tools/ProtoProxy | |
parent | Unified cPacketizer across all protocols. (diff) | |
download | cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar.gz cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar.bz2 cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar.lz cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar.xz cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.tar.zst cuberite-b913c5da69f362abbb70de6e11baca4cbce2b919.zip |
Diffstat (limited to '')
-rw-r--r-- | Tools/ProtoProxy/Connection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index 507d7cb90..f24747a24 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -805,11 +805,11 @@ bool cConnection::HandleClientHandshake(void) // Send the same packet to the server, but with our port: cByteBuffer Packet(512); - Packet.WriteVarInt(0); // Packet type - initial handshake - Packet.WriteVarInt(ProtocolVersion); + Packet.WriteVarInt32(0); // Packet type - initial handshake + Packet.WriteVarInt32(ProtocolVersion); Packet.WriteVarUTF8String(ServerHost); Packet.WriteBEUInt16(m_Server.GetConnectPort()); - Packet.WriteVarInt(NextState); + Packet.WriteVarInt32(NextState); AString Pkt; Packet.ReadAll(Pkt); cByteBuffer ToServer(512); @@ -2459,7 +2459,7 @@ bool cConnection::HandleServerStatusResponse(void) Log("Cannot find the description json element, ProtoProxy signature not inserted"); } cByteBuffer Packet(Response.size() + 50); - Packet.WriteVarInt(0); // Packet type - status response + Packet.WriteVarInt32(0); // Packet type - status response Packet.WriteVarUTF8String(Response); AString Pkt; Packet.ReadAll(Pkt); @@ -2775,7 +2775,7 @@ bool cConnection::ParseMetadata(cByteBuffer & a_Buffer, AString & a_Metadata) } rs = rs - static_cast<int>(a_Buffer.GetReadableSpace()); cByteBuffer LenBuf(8); - LenBuf.WriteVarInt(Len); + LenBuf.WriteVarInt32(Len); AString VarLen; LenBuf.ReadAll(VarLen); a_Metadata.append(VarLen); @@ -2960,7 +2960,7 @@ void cConnection::SendEncryptionKeyResponse(const AString & a_ServerPublicKey, c DataLog(EncryptedSecret, sizeof(EncryptedSecret), "Encrypted secret (%u bytes)", static_cast<unsigned>(sizeof(EncryptedSecret))); DataLog(EncryptedNonce, sizeof(EncryptedNonce), "Encrypted nonce (%u bytes)", static_cast<unsigned>(sizeof(EncryptedNonce))); cByteBuffer Len(5); - Len.WriteVarInt(static_cast<UInt32>(ToServer.GetReadableSpace())); + Len.WriteVarInt32(static_cast<UInt32>(ToServer.GetReadableSpace())); SERVERSEND(Len); SERVERSEND(ToServer); m_ServerState = csEncryptedUnderstood; |