diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-18 21:49:08 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-18 21:49:08 +0100 |
commit | b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df (patch) | |
tree | 93afcc6d60f697fe59a12b4e67a780a0c7a3907e /Tools/ProtoProxy/Connection.cpp | |
parent | Added levels of shrapnel (diff) | |
parent | Fixed chunkmap tree block replacing. (diff) | |
download | cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar.gz cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar.bz2 cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar.lz cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar.xz cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.tar.zst cuberite-b8fe024f9de9988b8aa2fc86a1d52b8dbf5712df.zip |
Diffstat (limited to 'Tools/ProtoProxy/Connection.cpp')
-rw-r--r-- | Tools/ProtoProxy/Connection.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index 91d2fc42f..46119ff42 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -131,8 +131,6 @@ } \ } - -#define MAX_ENC_LEN 1024 @@ -473,14 +471,14 @@ bool cConnection::SendData(SOCKET a_Socket, cByteBuffer & a_Data, const char * a -bool cConnection::SendEncryptedData(SOCKET a_Socket, cAESCFBEncryptor & a_Encryptor, const char * a_Data, int a_Size, const char * a_Peer) +bool cConnection::SendEncryptedData(SOCKET a_Socket, cAESCFBEncryptor & a_Encryptor, const char * a_Data, size_t a_Size, const char * a_Peer) { DataLog(a_Data, a_Size, "Encrypting %d bytes to %s", a_Size, a_Peer); const Byte * Data = (const Byte *)a_Data; while (a_Size > 0) { Byte Buffer[64 KiB]; - int NumBytes = (a_Size > sizeof(Buffer)) ? sizeof(Buffer) : a_Size; + size_t NumBytes = (a_Size > sizeof(Buffer)) ? sizeof(Buffer) : a_Size; a_Encryptor.ProcessData(Buffer, Data, NumBytes); bool res = SendData(a_Socket, (const char *)Buffer, NumBytes, a_Peer); if (!res) @@ -2263,7 +2261,9 @@ bool cConnection::HandleServerSpawnObjectVehicle(void) HANDLE_SERVER_PACKET_READ(ReadByte, Byte, Yaw); HANDLE_SERVER_PACKET_READ(ReadBEInt, int, DataIndicator); AString ExtraData; - short VelocityX, VelocityY, VelocityZ; + short VelocityX = 0; + short VelocityY = 0; + short VelocityZ = 0; if (DataIndicator != 0) { HANDLE_SERVER_PACKET_READ(ReadBEShort, short, SpeedX); @@ -2697,7 +2697,7 @@ bool cConnection::ParseMetadata(cByteBuffer & a_Buffer, AString & a_Metadata) a_Metadata.push_back(x); while (x != 0x7f) { - int Index = ((unsigned)((unsigned char)x)) & 0x1f; // Lower 5 bits = index + // int Index = ((unsigned)((unsigned char)x)) & 0x1f; // Lower 5 bits = index int Type = ((unsigned)((unsigned char)x)) >> 5; // Upper 3 bits = type int Length = 0; switch (Type) @@ -2772,7 +2772,7 @@ void cConnection::LogMetadata(const AString & a_Metadata, size_t a_IndentCount) { int Index = ((unsigned)((unsigned char)a_Metadata[pos])) & 0x1f; // Lower 5 bits = index int Type = ((unsigned)((unsigned char)a_Metadata[pos])) >> 5; // Upper 3 bits = type - int Length = 0; + // int Length = 0; switch (Type) { case 0: @@ -2827,7 +2827,7 @@ void cConnection::LogMetadata(const AString & a_Metadata, size_t a_IndentCount) ASSERT(!"Cannot parse item description from metadata"); return; } - int After = bb.GetReadableSpace(); + // int After = bb.GetReadableSpace(); int BytesConsumed = BytesLeft - bb.GetReadableSpace(); Log("%sslot[%d] = %s (%d bytes)", Indent.c_str(), Index, ItemDesc.c_str(), BytesConsumed); |