From 90fc51c4d03a941035b07d9d303ec542ff257b8b Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 15 Nov 2013 10:13:32 +0100 Subject: cRoot::SaveAllChunks() doesn't wait for the save (deadlocks). Rather, it only queues the save task onto each world's tick thread. --- MCServer/Plugins/APIDump/APIDesc.lua | 2 +- source/Root.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index cd3fe366a..9f95ce5e3 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1976,7 +1976,7 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage); GetWebAdmin = { Params = "", Return = "{{cWebAdmin|cWebAdmin}}", Notes = "Returns the cWebAdmin object." }, GetWorld = { Params = "WorldName", Return = "{{cWorld|cWorld}}", Notes = "Returns the cWorld object of the given world. It returns nil if there is no world with the given name." }, QueueExecuteConsoleCommand = { Params = "Message", Return = "", Notes = "Queues a console command for execution through the cServer class. The command will be executed in the tick thread. The command's output will be sent to console." }, - SaveAllChunks = { Params = "", Return = "", Notes = "Saves all the chunks in all the worlds." }, + SaveAllChunks = { Params = "", Return = "", Notes = "Saves all the chunks in all the worlds. Note that the saving is queued on each world's tick thread and this functions returns before the chunks are actually saved." }, SetPrimaryServerVersion = { Params = "Protocol Version", Return = "", Notes = "Sets the servers PrimaryServerVersion to the given protocol number." } }, Constants = diff --git a/source/Root.cpp b/source/Root.cpp index 701832be7..be5a0553c 100644 --- a/source/Root.cpp +++ b/source/Root.cpp @@ -489,7 +489,7 @@ void cRoot::SaveAllChunks(void) { for (WorldMap::iterator itr = m_WorldsByName.begin(); itr != m_WorldsByName.end(); ++itr) { - itr->second->SaveAllChunks(); + itr->second->QueueSaveAllChunks(); } } -- cgit v1.2.3