diff options
author | tycho <work.tycho@gmail.com> | 2015-05-30 18:22:03 +0200 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2015-06-05 23:31:21 +0200 |
commit | 19c95ee5645db8e8d1e04d80ca44c21c11732c7f (patch) | |
tree | e53899b0ea68446b99dee439d2ff4e521f9ea812 /src/ChunkSender.h | |
parent | Merge pull request #2206 from mc-server/APIDumpTimeStamp (diff) | |
download | cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar.gz cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar.bz2 cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar.lz cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar.xz cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.tar.zst cuberite-19c95ee5645db8e8d1e04d80ca44c21c11732c7f.zip |
Diffstat (limited to 'src/ChunkSender.h')
-rw-r--r-- | src/ChunkSender.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ChunkSender.h b/src/ChunkSender.h index 1376baeb3..1f87e9e08 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -53,7 +53,7 @@ class cChunkSender: { typedef cIsThread super; public: - cChunkSender(void); + cChunkSender(cWorld & a_World); ~cChunkSender(); enum eChunkPriority @@ -61,17 +61,16 @@ public: E_CHUNK_PRIORITY_HIGH = 0, E_CHUNK_PRIORITY_MEDIUM = 1, E_CHUNK_PRIORITY_LOW = 2, + PRIORITY_BROADCAST }; - bool Start(cWorld * a_World); + bool Start(); void Stop(void); - /// Notifies that a chunk has become ready and it should be sent to all its clients - void ChunkReady(int a_ChunkX, int a_ChunkZ); - /// Queues a chunk to be sent to a specific client void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client); + void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, std::list<cClientHandle *> a_Client); /// Removes the a_Client from all waiting chunk send operations void RemoveClient(cClientHandle * a_Client); @@ -119,17 +118,16 @@ protected: typedef std::vector<sBlockCoord> sBlockCoords; - cWorld * m_World; + cWorld & m_World; cCriticalSection m_CS; - cChunkCoordsList m_ChunksReady; sSendChunkList m_SendChunksLowPriority; sSendChunkList m_SendChunksMediumPriority; + sSendChunkList m_SendChunksBroadcastPriority; sSendChunkList m_SendChunksHighPriority; cEvent m_evtQueue; // Set when anything is added to m_ChunksReady cEvent m_evtRemoved; // Set when removed clients are safe to be deleted int m_RemoveCount; // Number of threads waiting for a client removal (m_evtRemoved needs to be set this many times) - // Data about the chunk that is being sent: // NOTE that m_BlockData[] is inherited from the cChunkDataCollector unsigned char m_BiomeMap[cChunkDef::Width * cChunkDef::Width]; |