Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Serializes one chunk's data to (possibly multiple) protocol versions. More...
#include <ChunkDataSerializer.h>
Public Types | |
enum | { RELEASE_1_8_0 = 47, RELEASE_1_9_0 = 107, RELEASE_1_9_4 = 110, RELEASE_1_13 = 393 } |
Public Member Functions | |
cChunkDataSerializer (const cChunkData &a_Data, const unsigned char *a_BiomeData, const eDimension a_Dimension) | |
const AString & | Serialize (int a_Version, int a_ChunkX, int a_ChunkZ, const std::map< UInt32, UInt32 > &a_BlockTypeMap) |
Serializes the contained chunk data into the specified protocol version. More... | |
Protected Types | |
using | Serializations = std::map< int, AString > |
Protected Member Functions | |
void | Serialize107 (AString &a_Data, int a_ChunkX, int a_ChunkZ) |
void | Serialize110 (AString &a_Data, int a_ChunkX, int a_ChunkZ) |
void | Serialize393 (AString &a_Data, int a_ChunkX, int a_ChunkZ, const std::map< UInt32, UInt32 > &a_BlockTypeMap) |
void | Serialize47 (AString &a_Data, int a_ChunkX, int a_ChunkZ) |
Protected Attributes | |
const unsigned char * | m_BiomeData |
The biomes in the chunk, to be serialized. More... | |
const cChunkData & | m_Data |
The data read from the chunk, to be serialized. More... | |
const eDimension | m_Dimension |
The dimension where the chunk resides. More... | |
Serializations | m_Serializations |
The per-protocol serialized data, cached for reuse for other clients. More... | |
Serializes one chunk's data to (possibly multiple) protocol versions.
Caches the serialized data for as long as this object lives, so that the same data can be sent to other clients using the same protocol.
Definition at line 12 of file ChunkDataSerializer.h.
|
protected |
Definition at line 37 of file ChunkDataSerializer.h.
anonymous enum |
Enumerator | |
---|---|
RELEASE_1_8_0 | |
RELEASE_1_9_0 | |
RELEASE_1_9_4 | |
RELEASE_1_13 |
Definition at line 15 of file ChunkDataSerializer.h.
cChunkDataSerializer::cChunkDataSerializer | ( | const cChunkData & | a_Data, |
const unsigned char * | a_BiomeData, | ||
const eDimension | a_Dimension | ||
) |
Definition at line 33 of file ChunkDataSerializer.cpp.
const AString & cChunkDataSerializer::Serialize | ( | int | a_Version, |
int | a_ChunkX, | ||
int | a_ChunkZ, | ||
const std::map< UInt32, UInt32 > & | a_BlockTypeMap | ||
) |
Serializes the contained chunk data into the specified protocol version.
TEMPORARY: a_BlockTypeMap is used for the 1.13+ protocols to map from BLOCKTYPE::META to NetBlockID. a_BlockTypeMap is ignored for pre-1.13 protocols.
Definition at line 48 of file ChunkDataSerializer.cpp.
|
protected |
Definition at line 168 of file ChunkDataSerializer.cpp.
|
protected |
Definition at line 301 of file ChunkDataSerializer.cpp.
|
protected |
Definition at line 437 of file ChunkDataSerializer.cpp.
|
protected |
Definition at line 82 of file ChunkDataSerializer.cpp.
|
protected |
The biomes in the chunk, to be serialized.
Definition at line 44 of file ChunkDataSerializer.h.
|
protected |
The data read from the chunk, to be serialized.
Definition at line 41 of file ChunkDataSerializer.h.
|
protected |
The dimension where the chunk resides.
Definition at line 47 of file ChunkDataSerializer.h.
|
protected |
The per-protocol serialized data, cached for reuse for other clients.
Definition at line 50 of file ChunkDataSerializer.h.