Stopping the ChunkSender upon server stop
git-svn-id: http://mc-server.googlecode.com/svn/trunk@401 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
e06c2001ba
commit
cb2de47247
@ -30,8 +30,7 @@ cChunkSender::cChunkSender(void) :
|
|||||||
|
|
||||||
cChunkSender::~cChunkSender()
|
cChunkSender::~cChunkSender()
|
||||||
{
|
{
|
||||||
m_ShouldTerminate = true;
|
Stop();
|
||||||
m_evtQueue.Set();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -48,6 +47,17 @@ bool cChunkSender::Start(cWorld * a_World)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cChunkSender::Stop(void)
|
||||||
|
{
|
||||||
|
m_ShouldTerminate = true;
|
||||||
|
m_evtQueue.Set();
|
||||||
|
Wait();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cChunkSender::ChunkReady(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
|
void cChunkSender::ChunkReady(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
|
||||||
{
|
{
|
||||||
// This is probably never gonna be called twice for the same chunk, and if it is, we don't mind, so we don't check
|
// This is probably never gonna be called twice for the same chunk, and if it is, we don't mind, so we don't check
|
||||||
|
@ -51,6 +51,8 @@ public:
|
|||||||
|
|
||||||
bool Start(cWorld * a_World);
|
bool Start(cWorld * a_World);
|
||||||
|
|
||||||
|
void Stop(void);
|
||||||
|
|
||||||
/// Notifies that a chunk has become ready and it should be sent to all its clients
|
/// Notifies that a chunk has become ready and it should be sent to all its clients
|
||||||
void ChunkReady(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
|
void ChunkReady(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ cWorld::~cWorld()
|
|||||||
delete m_RedstoneSimulator;
|
delete m_RedstoneSimulator;
|
||||||
|
|
||||||
m_Generator.Stop();
|
m_Generator.Stop();
|
||||||
|
m_ChunkSender.Stop();
|
||||||
|
|
||||||
UnloadUnusedChunks();
|
UnloadUnusedChunks();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user