summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 0a97ba6c8..faf583fbb 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -570,19 +570,26 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
return;
}
+ cByteBuffer Buffer(a_Length);
+ Buffer.Write(a_Data, a_Length);
+
int BlockX, BlockY, BlockZ;
AString Command;
- switch (a_Data[0])
+ char Mode;
+
+ Buffer.ReadChar(Mode);
+
+ switch (Mode)
{
case 0x00:
{
- BlockX = GetBEInt(a_Data + 1);
- BlockY = GetBEInt(a_Data + 5);
- BlockZ = GetBEInt(a_Data + 9);
+ Buffer.ReadBEInt(BlockX);
+ Buffer.ReadBEInt(BlockY);
+ Buffer.ReadBEInt(BlockZ);
- Command = AString(a_Data + 14, (int)a_Data[13]);
+ Buffer.ReadVarUTF8String(Command);
break;
}