diff options
author | Mattes D <github@xoft.cz> | 2014-10-24 10:13:54 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-24 10:13:54 +0200 |
commit | 2940ced832e506fb1bb2b5292d49b2c7c31afb5b (patch) | |
tree | 9b5c06b80b752eda2cb5dd25d271d50d9eb1dc1f /src/ChunkSender.h | |
parent | Reimplemented cEvent using C++11 primitives. (diff) | |
parent | Merge pull request #1565 from mc-server/MergedIniFile (diff) | |
download | cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar.gz cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar.bz2 cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar.lz cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar.xz cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.tar.zst cuberite-2940ced832e506fb1bb2b5292d49b2c7c31afb5b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkSender.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ChunkSender.h b/src/ChunkSender.h index f17029aea..7cd7ddd86 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -75,6 +75,13 @@ class cChunkSender: public: cChunkSender(void); ~cChunkSender(); + + enum eChunkPriority + { + E_CHUNK_PRIORITY_HIGH = 0, + E_CHUNK_PRIORITY_MEDIUM = 1, + E_CHUNK_PRIORITY_LOW = 2, + }; bool Start(cWorld * a_World); @@ -84,7 +91,7 @@ public: 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, cClientHandle * a_Client); + void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client); /// Removes the a_Client from all waiting chunk send operations void RemoveClient(cClientHandle * a_Client); @@ -136,7 +143,9 @@ protected: cCriticalSection m_CS; cChunkCoordsList m_ChunksReady; - sSendChunkList m_SendChunks; + sSendChunkList m_SendChunksLowPriority; + sSendChunkList m_SendChunksMediumPriority; + 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) |