summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-06 21:27:53 +0200
committerHowaner <franzi.moos@googlemail.com>2014-10-06 21:27:53 +0200
commitb493beb3bbac05d0402a6e388a61bf446c6c00ff (patch)
treef8ded1c4d42bbd398285c78016d5139d9c5ef56c /src/ChunkSender.h
parentMerge branch 'master' into ChunkLoader (diff)
downloadcuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar.gz
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar.bz2
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar.lz
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar.xz
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.tar.zst
cuberite-b493beb3bbac05d0402a6e388a61bf446c6c00ff.zip
Diffstat (limited to 'src/ChunkSender.h')
-rw-r--r--src/ChunkSender.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ChunkSender.h b/src/ChunkSender.h
index a0e9087a9..3a1e1f5ea 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);
@@ -96,11 +103,13 @@ protected:
{
int m_ChunkX;
int m_ChunkZ;
+ eChunkPriority m_Priority;
cClientHandle * m_Client;
- sSendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client) :
+ sSendChunk(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client) :
m_ChunkX(a_ChunkX),
m_ChunkZ(a_ChunkZ),
+ m_Priority(a_Priority),
m_Client(a_Client)
{
}
@@ -113,6 +122,11 @@ protected:
(a_Other.m_Client == m_Client)
);
}
+
+ bool operator < (const sSendChunk & a_Other)
+ {
+ return (m_Priority < a_Other.m_Priority);
+ }
} ;
typedef std::list<sSendChunk> sSendChunkList;