summaryrefslogtreecommitdiffstats
path: root/source/ChunkSender.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-05 17:41:57 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-05 17:41:57 +0100
commit4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a (patch)
treeccc5f55d8f7a15f08bab8f0222fd1b2f95e5d7a2 /source/ChunkSender.h
parentRemoved redstone debugging: powered dirt blocks change into stone (diff)
downloadcuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar.gz
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar.bz2
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar.lz
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar.xz
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.tar.zst
cuberite-4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a.zip
Diffstat (limited to '')
-rw-r--r--source/ChunkSender.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/source/ChunkSender.h b/source/ChunkSender.h
new file mode 100644
index 000000000..a56e797da
--- /dev/null
+++ b/source/ChunkSender.h
@@ -0,0 +1,63 @@
+
+// ChunkSender.h
+
+// Interfaces to the cChunkSender class representing the thread that waits for chunks becoming ready (loaded / generated) and sends them to clients
+
+
+
+
+
+#pragma once
+
+#include "cIsThread.h"
+#include "cChunk.h"
+#include "packets/cPacket.h"
+
+
+
+
+
+class cWorld;
+
+
+
+
+
+class cChunkSender:
+ public cIsThread,
+ public cChunkDataCallback
+{
+ typedef cIsThread super;
+public:
+ cChunkSender(void);
+ ~cChunkSender();
+
+ bool Start(cWorld * a_World);
+
+ void ChunkReady(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
+
+protected:
+
+ cWorld * m_World;
+
+ cCriticalSection m_CS;
+ cChunkCoordsList m_ChunksReady;
+ cEvent m_Event; // Set when anything is added to m_ChunksReady
+
+ // Data about the chunk that is being sent:
+ char m_BlockData[cChunk::c_BlockDataSize];
+ PacketList m_Packets; // Accumulator for the entity-packets to send
+
+ // cIsThread override:
+ virtual void Execute(void) override;
+
+ // cChunkDataCallback overrides:
+ virtual void BlockData(const char * a_Data) override;
+ virtual void Entity(cEntity * a_Entity) override;
+ virtual void BlockEntity(cBlockEntity * a_Entity) override;
+
+} ;
+
+
+
+