summaryrefslogtreecommitdiffstats
path: root/src/ByteBuffer.h
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/ByteBuffer.h
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 '')
-rw-r--r--src/ByteBuffer.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h
index b5679776e..0a4935327 100644
--- a/src/ByteBuffer.h
+++ b/src/ByteBuffer.h
@@ -64,19 +64,20 @@ public:
bool ReadBEDouble (double & a_Value);
bool ReadBool (bool & a_Value);
bool ReadBEUTF16String16(AString & a_Value); // string length as BE short, then string as UTF-16BE
- bool ReadVarInt (UInt32 & a_Value);
+ bool ReadVarInt32 (UInt32 & a_Value);
+ bool ReadVarInt64 (UInt64 & a_Value);
bool ReadVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8
bool ReadLEInt (int & a_Value);
- bool ReadPosition (int & a_BlockX, int & a_BlockY, int & a_BlockZ);
+ bool ReadPosition64 (int & a_BlockX, int & a_BlockY, int & a_BlockZ);
- /** Reads VarInt, assigns it to anything that can be assigned from an UInt32 (unsigned short, char, Byte, double, ...) */
+ /** Reads VarInt, assigns it to anything that can be assigned from an UInt64 (unsigned short, char, Byte, double, ...) */
template <typename T> bool ReadVarInt(T & a_Value)
{
- UInt32 v;
- bool res = ReadVarInt(v);
+ UInt64 v;
+ bool res = ReadVarInt64(v);
if (res)
{
- a_Value = v;
+ a_Value = static_cast<T>(v);
}
return res;
}
@@ -93,7 +94,8 @@ public:
bool WriteBEFloat (float a_Value);
bool WriteBEDouble (double a_Value);
bool WriteBool (bool a_Value);
- bool WriteVarInt (UInt32 a_Value);
+ bool WriteVarInt32 (UInt32 a_Value);
+ bool WriteVarInt64 (UInt64 a_Value);
bool WriteVarUTF8String (const AString & a_Value); // string length as VarInt, then string as UTF-8
bool WriteLEInt32 (Int32 a_Value);
bool WritePosition64 (Int32 a_BlockX, Int32 a_BlockY, Int32 a_BlockZ);