From a4a418a679f1ac760a8763edd856f0178cfc6dde Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 25 May 2012 07:18:52 +0000 Subject: Merged the composable_generator branch into the trunk git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ChunkSender.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'source/ChunkSender.h') 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; -- cgit v1.2.3