summaryrefslogtreecommitdiffstats
path: root/source/ChunkSender.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-07 21:06:18 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-07 21:06:18 +0100
commit4544d5d3b9fe9c1053f5eaea026b651291712a21 (patch)
tree3854a0eb1e14c0f4b1101985ae0dae12bf914ba2 /source/ChunkSender.h
parentWSSCompact: fixed switched version values (!); removed unused methods (diff)
downloadcuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar.gz
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar.bz2
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar.lz
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar.xz
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.tar.zst
cuberite-4544d5d3b9fe9c1053f5eaea026b651291712a21.zip
Diffstat (limited to 'source/ChunkSender.h')
-rw-r--r--source/ChunkSender.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/ChunkSender.h b/source/ChunkSender.h
index d0e50f341..b2ada5a09 100644
--- a/source/ChunkSender.h
+++ b/source/ChunkSender.h
@@ -15,6 +15,10 @@ Chunk data is queried using the cChunkDataCallback interface.
It is cached inside the ChunkSender object during the query and then processed after the query ends.
Note that the data needs to be compressed only *after* the query finishes,
because the query callbacks run with ChunkMap's CS locked.
+
+A client may remove itself from all direct requests(QueueSendChunkTo()) by calling RemoveClient();
+this ensures that the client's Send() won't be called anymore by ChunkSender.
+Note that it may be called by world's BroadcastToChunk() if the client is still in the chunk.
*/
@@ -78,10 +82,11 @@ protected:
cWorld * m_World;
- cCriticalSection m_CS;
- cChunkCoordsList m_ChunksReady;
- sSendChunkList m_SendChunks;
- cEvent m_Event; // Set when anything is added to m_ChunksReady
+ cCriticalSection m_CS;
+ cChunkCoordsList m_ChunksReady;
+ sSendChunkList m_SendChunks;
+ cEvent m_evtQueue; // Set when anything is added to m_ChunksReady
+ cEvent m_evtRemoved; // Set when removed clients are safe to be deleted
// Data about the chunk that is being sent:
char m_BlockData[cChunk::c_BlockDataSize];