summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-24 10:19:13 +0200
committerMattes D <github@xoft.cz>2014-10-24 10:19:13 +0200
commit765bf006ad28d6dfcddd6c29ec203bbc7753e332 (patch)
tree2ddd79061104d4a4f80442a432a52fd81120e631 /src/ChunkSender.h
parentSuggestions (diff)
parentMerge pull request #1565 from mc-server/MergedIniFile (diff)
downloadcuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar.gz
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar.bz2
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar.lz
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar.xz
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.tar.zst
cuberite-765bf006ad28d6dfcddd6c29ec203bbc7753e332.zip
Diffstat (limited to 'src/ChunkSender.h')
-rw-r--r--src/ChunkSender.h13
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)