diff options
author | Mattes D <github@xoft.cz> | 2014-10-23 22:49:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-23 22:49:17 +0200 |
commit | 4df924cf4b774b68fc7cc6b144e82e47c9fe4444 (patch) | |
tree | 454cee2b4b47387ba19e7537de3d5d699be7f9fe /src/ChunkSender.h | |
parent | Fixed a crash in redstone simulator. (diff) | |
parent | Use 3 priorities. (diff) | |
download | cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.gz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.bz2 cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.lz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.xz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.zst cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.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) |