summaryrefslogtreecommitdiffstats
path: root/source/ChunkDataSerializer.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-26 23:01:07 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-26 23:01:07 +0200
commitd97ad781b4ea1998b9819f139c7ab7806161042e (patch)
tree84f8b2e37bb141b7ef57e34385ab0be7b7dc60d2 /source/ChunkDataSerializer.h
parentTurned a common assert into a warning log (diff)
downloadcuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.gz
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.bz2
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.lz
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.xz
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.zst
cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.zip
Diffstat (limited to '')
-rw-r--r--source/ChunkDataSerializer.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/ChunkDataSerializer.h b/source/ChunkDataSerializer.h
new file mode 100644
index 000000000..4c2f4fb4c
--- /dev/null
+++ b/source/ChunkDataSerializer.h
@@ -0,0 +1,46 @@
+
+// ChunkDataSerializer.h
+
+// Interfaces to the cChunkDataSerializer class representing the object that can:
+// - serialize chunk data to different protocol versions
+// - cache such serialized data for multiple clients
+
+
+
+
+
+class cChunkDataSerializer
+{
+protected:
+ const cChunkDef::BlockTypes & m_BlockTypes;
+ const cChunkDef::BlockNibbles & m_BlockMetas;
+ const cChunkDef::BlockNibbles & m_BlockLight;
+ const cChunkDef::BlockNibbles & m_BlockSkyLight;
+ const unsigned char * m_BiomeData;
+
+ typedef std::map<int, AString> Serializations;
+
+ Serializations m_Serializations;
+
+ void Serialize29(AString & a_Data); // Release 1.2.4 and 1.2.5
+
+public:
+ enum
+ {
+ RELEASE_1_2_5 = 29,
+ } ;
+
+ cChunkDataSerializer(
+ const cChunkDef::BlockTypes & a_BlockTypes,
+ const cChunkDef::BlockNibbles & a_BlockMetas,
+ const cChunkDef::BlockNibbles & a_BlockLight,
+ const cChunkDef::BlockNibbles & a_BlockSkyLight,
+ const unsigned char * a_BiomeData
+ );
+
+ const AString & Serialize(int a_Version); // Returns one of the internal m_Serializations[]
+} ;
+
+
+
+