summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ChunkDataSerializer.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-27 22:35:13 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-27 22:35:13 +0100
commita6630d32394120a78af56bc612fa3c3449283248 (patch)
tree2c791266b0f213cd56961299da8d2258b8f85d8e /src/Protocol/ChunkDataSerializer.h
parentFixed spawn point being generally in an ocean (diff)
parentVoronoi-related biomegens use the new cVoronoiMap class. (diff)
downloadcuberite-a6630d32394120a78af56bc612fa3c3449283248.tar
cuberite-a6630d32394120a78af56bc612fa3c3449283248.tar.gz
cuberite-a6630d32394120a78af56bc612fa3c3449283248.tar.bz2
cuberite-a6630d32394120a78af56bc612fa3c3449283248.tar.lz
cuberite-a6630d32394120a78af56bc612fa3c3449283248.tar.xz
cuberite-a6630d32394120a78af56bc612fa3c3449283248.tar.zst
cuberite-a6630d32394120a78af56bc612fa3c3449283248.zip
Diffstat (limited to 'src/Protocol/ChunkDataSerializer.h')
-rw-r--r--src/Protocol/ChunkDataSerializer.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Protocol/ChunkDataSerializer.h b/src/Protocol/ChunkDataSerializer.h
new file mode 100644
index 000000000..a42856356
--- /dev/null
+++ b/src/Protocol/ChunkDataSerializer.h
@@ -0,0 +1,48 @@
+
+// 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
+ void Serialize39(AString & a_Data); // Release 1.3.1 and 1.3.2
+
+public:
+ enum
+ {
+ RELEASE_1_2_5 = 29,
+ RELEASE_1_3_2 = 39,
+ } ;
+
+ 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[]
+} ;
+
+
+
+