summaryrefslogtreecommitdiffstats
path: root/source/ChunkSender.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-05-25 09:18:52 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-05-25 09:18:52 +0200
commita4a418a679f1ac760a8763edd856f0178cfc6dde (patch)
tree85300ca3a2b3a942998a0c864ae90894857ebf5f /source/ChunkSender.h
parentFixed output directory structure in the "Release profiled" configuration (diff)
downloadcuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.gz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.bz2
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.lz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.xz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.zst
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.zip
Diffstat (limited to 'source/ChunkSender.h')
-rw-r--r--source/ChunkSender.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/source/ChunkSender.h b/source/ChunkSender.h
index ae9a8b5c5..196db1dfa 100644
--- a/source/ChunkSender.h
+++ b/source/ChunkSender.h
@@ -40,6 +40,33 @@ class cClientHandle;
+// fwd:
+class cChunkSender;
+
+
+
+
+
+/// Callback that can be used to notify chunk sender upon another chunkcoord notification
+class cNotifyChunkSender :
+ public cChunkCoordCallback
+{
+ virtual void Call(int a_ChunkX, int a_ChunkZ) override;
+
+ cChunkSender * m_ChunkSender;
+public:
+ cNotifyChunkSender(cChunkSender * a_ChunkSender) : m_ChunkSender(a_ChunkSender) {}
+
+ void SetChunkSender(cChunkSender * a_ChunkSender)
+ {
+ m_ChunkSender = a_ChunkSender;
+ }
+} ;
+
+
+
+
+
class cChunkSender:
public cIsThread,
public cChunkDataCollector
@@ -101,9 +128,11 @@ protected:
cEvent m_evtRemoved; // Set when removed clients are safe to be deleted
int m_RemoveCount; // Number of threads waiting for a client removal (m_evtRemoved needs to be set this many times)
+ cNotifyChunkSender m_Notify; // Used for chunks that don't have a valid lighting - they will be re-queued after lightcalc
+
// Data about the chunk that is being sent:
// NOTE that m_BlockData[] is inherited from the cChunkDataCollector
- BIOMETYPE m_BiomeData[cChunkDef::Width * cChunkDef::Width];
+ unsigned char m_BiomeMap[cChunkDef::Width * cChunkDef::Width];
PacketList m_Packets; // Accumulator for the entity-packets to send
// cIsThread override:
@@ -111,6 +140,7 @@ protected:
// cChunkDataCollector overrides:
// (Note that they are called while the ChunkMap's CS is locked - don't do heavy calculations here!)
+ virtual void BiomeData (const cChunkDef::BiomeMap * a_BiomeMap) override;
virtual void Entity (cEntity * a_Entity) override;
virtual void BlockEntity (cBlockEntity * a_Entity) override;