summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.h
diff options
context:
space:
mode:
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;