Makes server save in background, stops server lag on save

Keeping lag broadcast just in case
This commit is contained in:
Twitchy 2011-07-03 18:27:57 +12:00 committed by Steven French
parent 473d554de1
commit 058ae345d0
3 changed files with 18 additions and 7 deletions

View file

@ -67,11 +67,9 @@ namespace TShockAPI
if (worldpath != null && !Directory.Exists(worldpath))
Directory.CreateDirectory(worldpath);
//Tools.Broadcast("Server map saving, potential lag spike");
WorldGen.saveWorld();
Console.WriteLine("World backed up");
Log.Info(string.Format("World backed up ({0})", Main.worldPathName));
Tools.Broadcast("Server map saving, potential lag spike");
Thread SaveWorld = new Thread(Tools.SaveWorld);
SaveWorld.Start();
Main.worldPathName = worldname;
}