summaryrefslogtreecommitdiffstats
path: root/source/cServer.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-16 20:32:31 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-16 20:32:31 +0100
commiteefe71f593d1d68c5961482dac062e1a80950724 (patch)
tree9dc973f625e9e026f4f517143917e2b640dfc4b1 /source/cServer.cpp
parentcWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively. (diff)
downloadcuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar.gz
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar.bz2
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar.lz
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar.xz
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.tar.zst
cuberite-eefe71f593d1d68c5961482dac062e1a80950724.zip
Diffstat (limited to 'source/cServer.cpp')
-rw-r--r--source/cServer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/cServer.cpp b/source/cServer.cpp
index 69f19028d..a026a0672 100644
--- a/source/cServer.cpp
+++ b/source/cServer.cpp
@@ -436,6 +436,7 @@ void cServer::ServerCommand( const char * a_Cmd )
printf("help - Shows this message\n");
printf("save-all - Saves all loaded chunks to disk\n");
printf("list - Lists all players currently in server\n");
+ printf("unload - Unloads all unused chunks\n");
printf("numchunks - Shows number of chunks currently loaded\n");
printf("say - Sends a chat message to all players\n");
printf("restart - Kicks all clients, and saves everything\n");
@@ -453,6 +454,13 @@ void cServer::ServerCommand( const char * a_Cmd )
cRoot::Get()->GetWorld()->SaveAllChunks(); // TODO - Force ALL worlds to save their chunks
return;
}
+ if (split[0].compare("unload") == 0)
+ {
+ LOG("Num loaded chunks before: %i", cRoot::Get()->GetTotalChunkCount() );
+ cRoot::Get()->GetDefaultWorld()->UnloadUnusedChunks(); // TODO: Iterate through ALL worlds
+ LOG("Num loaded chunks after: %i", cRoot::Get()->GetTotalChunkCount() );
+ return;
+ }
if( split[0].compare( "list" ) == 0 )
{
class cPlayerLogger : public cPlayerListCallback
@@ -468,7 +476,7 @@ void cServer::ServerCommand( const char * a_Cmd )
}
if( split[0].compare( "numchunks" ) == 0 )
{
- printf("Num loaded chunks: %i\n", cRoot::Get()->GetTotalChunkCount() );
+ LOG("Num loaded chunks: %i\n", cRoot::Get()->GetTotalChunkCount() );
return;
}