Refactored server stop and world save operations fixing race conditions so as to ensure operations always happen in a predicable order. This fixes output not appearing in the console / log for example. This adds TShock.Utils.StopServer method used by IGA, rcon and the RestAPI.

Fixed console title set not working

Optimised command line parsing

Made Utils a singleton to enforce the fact that only one copy should ever exist

Added name to /v2/user/read output as users can be found by id
This commit is contained in:
stevenh 2012-02-20 22:31:16 +00:00
parent 84789ff4d5
commit d34199b17d
7 changed files with 228 additions and 121 deletions

View file

@ -253,9 +253,7 @@ namespace TShockAPI
WorldGen.genRand = new Random();
if (text.StartsWith("exit"))
{
TShock.Utils.ForceKickAll("Server shutting down!");
WorldGen.saveWorld(false);
Netplay.disconnect = true;
TShock.Utils.StopServer();
return "Server shutting down.";
}
else if (text.StartsWith("playing") || text.StartsWith("/playing"))