Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -747,14 +747,14 @@ void cChunkMap::RemoveChunkClient(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cCli
|
||||
|
||||
|
||||
|
||||
void cChunkMap::RemoveClientFromChunks(cClientHandle * a_Client, const cChunkCoordsList & a_Chunks)
|
||||
void cChunkMap::RemoveClientFromChunks(cClientHandle * a_Client)
|
||||
{
|
||||
cCSLock Lock(m_CSLayers);
|
||||
|
||||
for (cChunkCoordsList::const_iterator itr = a_Chunks.begin(); itr != a_Chunks.end(); ++itr)
|
||||
for (cChunkLayerList::const_iterator itr = m_Layers.begin(); itr != m_Layers.end(); ++itr)
|
||||
{
|
||||
GetChunkNoGen(itr->m_ChunkX, itr->m_ChunkY, itr->m_ChunkZ)->RemoveClient(a_Client);
|
||||
}
|
||||
(*itr)->RemoveClient(a_Client);
|
||||
} // for itr - m_Layers[]
|
||||
}
|
||||
|
||||
|
||||
@@ -1006,6 +1006,21 @@ void cChunkMap::cChunkLayer::Tick(float a_Dt, MTRand & a_TickRand)
|
||||
|
||||
|
||||
|
||||
void cChunkMap::cChunkLayer::RemoveClient(cClientHandle * a_Client)
|
||||
{
|
||||
for (int i = 0; i < ARRAYCOUNT(m_Chunks); i++)
|
||||
{
|
||||
if (m_Chunks[i] != NULL)
|
||||
{
|
||||
m_Chunks[i]->RemoveClient(a_Client);
|
||||
}
|
||||
} // for i - m_Chunks[]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int cChunkMap::cChunkLayer::GetNumChunksLoaded(void) const
|
||||
{
|
||||
int NumChunks = 0;
|
||||
|
||||
Reference in New Issue
Block a user