git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6

This commit is contained in:
madmaxoft@gmail.com
2012-08-26 21:01:07 +00:00
parent 17253d2c90
commit d97ad781b4
17 changed files with 259 additions and 153 deletions
+46
View File
@@ -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[]
} ;