summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-06 22:58:32 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-06 22:58:32 +0100
commitb20fa171a4ddc5bc57073a8e058da39557d25e03 (patch)
tree1bb057ed7b9f6bde670e559f0004ab81707d81e8
parentFixed redstone repeater bug where it could not get the direction when it has delay bits set (diff)
downloadcuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar.gz
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar.bz2
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar.lz
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar.xz
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.tar.zst
cuberite-b20fa171a4ddc5bc57073a8e058da39557d25e03.zip
-rw-r--r--source/ChunkSender.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/ChunkSender.h b/source/ChunkSender.h
index e61c45d1e..d0e50f341 100644
--- a/source/ChunkSender.h
+++ b/source/ChunkSender.h
@@ -3,7 +3,19 @@
// Interfaces to the cChunkSender class representing the thread that waits for chunks becoming ready (loaded / generated) and sends them to clients
-
+/*
+The whole thing is a thread that runs in a loop, waiting for either:
+ "finished chunks" (ChunkReady()), or
+ "chunks to send" (QueueSendChunkTo() )
+to come to a queue.
+And once they do, it requests the chunk data and sends it all away, either
+ broadcasting (ChunkReady), or
+ sends to a specific client (QueueSendChunkTo)
+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.
+*/
@@ -79,6 +91,7 @@ protected:
virtual void Execute(void) override;
// cChunkDataCallback overrides:
+ // (Note that they are called while the ChunkMap's CS is locked - don't do heavy calculations here!)
virtual void BlockData(const char * a_Data) override;
virtual void Entity(cEntity * a_Entity) override;
virtual void BlockEntity(cBlockEntity * a_Entity) override;