1
0

Removed world-saving log messages.

Ref.: http://forum.mc-server.org/showthread.php?tid=1518
This commit is contained in:
madmaxoft 2014-07-04 11:50:50 +02:00
parent 20afd5d70e
commit 632e8680b1
3 changed files with 5 additions and 35 deletions

View File

@ -2776,10 +2776,8 @@ bool cWorld::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunk
void cWorld::SaveAllChunks(void) void cWorld::SaveAllChunks(void)
{ {
LOGINFO("Saving all chunks...");
m_LastSave = m_WorldAge; m_LastSave = m_WorldAge;
m_ChunkMap->SaveAllChunks(); m_ChunkMap->SaveAllChunks();
m_Storage.QueueSavedMessage();
} }

View File

@ -17,13 +17,6 @@
/// If a chunk with this Y coord is de-queued, it is a signal to emit the saved-all message (cWorldStorage::QueueSavedMessage())
#define CHUNK_Y_MESSAGE 2
/// Example storage schema - forgets all chunks ;) /// Example storage schema - forgets all chunks ;)
class cWSSForgetful : class cWSSForgetful :
public cWSSchema public cWSSchema
@ -168,17 +161,6 @@ void cWorldStorage::QueueSaveChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
void cWorldStorage::QueueSavedMessage(void)
{
// Pushes a special coord pair into the queue, signalizing a message instead
m_SaveQueue.EnqueueItem(cChunkCoords(0, CHUNK_Y_MESSAGE, 0));
m_Event.Set();
}
void cWorldStorage::UnqueueLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ) void cWorldStorage::UnqueueLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{ {
m_LoadQueue.Remove(sChunkLoad(a_ChunkX, a_ChunkY, a_ChunkZ,true)); m_LoadQueue.Remove(sChunkLoad(a_ChunkX, a_ChunkY, a_ChunkZ,true));
@ -286,12 +268,6 @@ bool cWorldStorage::SaveOneChunk(void)
{ {
cChunkCoords ToSave(0, 0, 0); cChunkCoords ToSave(0, 0, 0);
bool ShouldSave = m_SaveQueue.TryDequeueItem(ToSave); bool ShouldSave = m_SaveQueue.TryDequeueItem(ToSave);
if(ShouldSave) {
if (ToSave.m_ChunkY == CHUNK_Y_MESSAGE)
{
LOGINFO("Saved all chunks in world %s", m_World->GetName().c_str());
return ShouldSave;
}
if (ShouldSave && m_World->IsChunkValid(ToSave.m_ChunkX, ToSave.m_ChunkZ)) if (ShouldSave && m_World->IsChunkValid(ToSave.m_ChunkX, ToSave.m_ChunkZ))
{ {
m_World->MarkChunkSaving(ToSave.m_ChunkX, ToSave.m_ChunkZ); m_World->MarkChunkSaving(ToSave.m_ChunkX, ToSave.m_ChunkZ);
@ -300,7 +276,6 @@ bool cWorldStorage::SaveOneChunk(void)
m_World->MarkChunkSaved(ToSave.m_ChunkX, ToSave.m_ChunkZ); m_World->MarkChunkSaved(ToSave.m_ChunkX, ToSave.m_ChunkZ);
} }
} }
}
return ShouldSave; return ShouldSave;
} }

View File

@ -67,9 +67,6 @@ public:
void QueueLoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, bool a_Generate); // Queues the chunk for loading; if not loaded, the chunk will be generated if a_Generate is true void QueueLoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, bool a_Generate); // Queues the chunk for loading; if not loaded, the chunk will be generated if a_Generate is true
void QueueSaveChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ); void QueueSaveChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
/// Signals that a message should be output to the console when all the chunks have been saved
void QueueSavedMessage(void);
/// Loads the chunk specified; returns true on success, false on failure /// Loads the chunk specified; returns true on success, false on failure
bool LoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ); bool LoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ);