75 void QueueSendChunkTo(
int a_ChunkX,
int a_ChunkZ,
Priority a_Priority,
const std::vector<cClientHandle *> & a_Clients);
79 using WeakClients = std::set<std::weak_ptr<cClientHandle>, std::owner_less<std::weak_ptr<cClientHandle>>>;
114 std::unordered_map<cChunkCoords, sSendChunk, cChunkCoordsHash>
m_ChunkInfo;
124 virtual void Execute(
void)
override;
A simple implementation of the cChunkDataCallback interface that just copies the cChunkData.
Wraps the chunk coords into a single structure.
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
virtual void BiomeMap(const cChunkDef::BiomeMap &a_BiomeMap) override
unsigned char m_BiomeMap[cChunkDef::Width *cChunkDef::Width]
virtual void BlockEntity(cBlockEntity *a_Entity) override
virtual void Execute(void) override
This function, overloaded by the descendants, is called in the new thread.
std::set< std::weak_ptr< cClientHandle >, std::owner_less< std::weak_ptr< cClientHandle > >> WeakClients
virtual ~cChunkSender() override
void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, Priority a_Priority, cClientHandle *a_Client)
Queues a chunk to be sent to a specific client.
void SendChunk(int a_ChunkX, int a_ChunkZ, const WeakClients &a_Clients)
Sends the specified chunk to all the specified clients.
std::vector< UInt32 > m_EntityIDs
cChunkSender(cWorld &a_World)
cChunkDataSerializer m_Serializer
An instance of a chunk serializer, held to maintain its internal cache.
std::priority_queue< sChunkQueue > m_SendChunks
std::unordered_map< cChunkCoords, sSendChunk, cChunkCoordsHash > m_ChunkInfo
Priority
Tag indicating urgency of chunk to be sent.
std::vector< Vector3i > m_BlockEntities
virtual void Entity(cEntity *a_Entity) override
bool operator<(const sChunkQueue &a_Other) const
Used for sending chunks to specific clients.
sSendChunk(cChunkCoords a_Chunk, Priority a_Priority)
cIsThread(AString &&a_ThreadName)
Serializes one chunk's data to (possibly multiple) protocol versions.