2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
2014-09-03 21:22:35 -04:00
|
|
|
void Serialize39(AString & a_Data); // Release 1.3.1 to 1.7.10
|
2014-09-19 09:07:01 -04:00
|
|
|
void Serialize47(AString & a_Data, int a_ChunkX, int a_ChunkZ); // Release 1.8
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RELEASE_1_3_2 = 39,
|
2014-09-03 21:22:35 -04:00
|
|
|
RELEASE_1_8_0 = 47,
|
2013-07-29 07:13:03 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2014-09-07 18:36:30 -04:00
|
|
|
const AString & Serialize(int a_Version, int a_ChunkX, int a_ChunkZ); // Returns one of the internal m_Serializations[]
|
2013-07-29 07:13:03 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|