summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ChunkDataSerializer.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-22 23:09:23 +0100
committerMattes D <github@xoft.cz>2015-03-22 23:09:23 +0100
commitb913c5da69f362abbb70de6e11baca4cbce2b919 (patch)
tree782854bd86c7165e38459e592fb81979270f732a /src/Protocol/ChunkDataSerializer.cpp
parentUnified cPacketizer across all protocols. (diff)
downloadcuberite-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 'src/Protocol/ChunkDataSerializer.cpp')
-rw-r--r--src/Protocol/ChunkDataSerializer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Protocol/ChunkDataSerializer.cpp b/src/Protocol/ChunkDataSerializer.cpp
index e850ceaec..60fd5f935 100644
--- a/src/Protocol/ChunkDataSerializer.cpp
+++ b/src/Protocol/ChunkDataSerializer.cpp
@@ -187,7 +187,7 @@ void cChunkDataSerializer::Serialize47(AString & a_Data, int a_ChunkX, int a_Chu
// Create the packet:
cByteBuffer Packet(512 KiB);
- Packet.WriteVarInt(0x21); // Packet id (Chunk Data packet)
+ Packet.WriteVarInt32(0x21); // Packet id (Chunk Data packet)
Packet.WriteBEInt32(a_ChunkX);
Packet.WriteBEInt32(a_ChunkZ);
Packet.WriteBool(true); // "Ground-up continuous", or rather, "biome data present" flag
@@ -201,7 +201,7 @@ void cChunkDataSerializer::Serialize47(AString & a_Data, int a_ChunkX, int a_Chu
sizeof(m_BlockSkyLight) + // Block sky light
BiomeDataSize // Biome data
);
- Packet.WriteVarInt(ChunkSize);
+ Packet.WriteVarInt32(ChunkSize);
// Write the block types to the packet:
for (size_t Index = 0; Index < cChunkDef::NumBlocks; Index++)
@@ -234,8 +234,8 @@ void cChunkDataSerializer::Serialize47(AString & a_Data, int a_ChunkX, int a_Chu
else
{
AString PostData;
- Buffer.WriteVarInt((UInt32)Packet.GetUsedSpace() + 1);
- Buffer.WriteVarInt(0);
+ Buffer.WriteVarInt32(static_cast<UInt32>(Packet.GetUsedSpace() + 1));
+ Buffer.WriteVarInt32(0);
Buffer.ReadAll(PostData);
Buffer.CommitRead();