From 13e00c7d2d375206174fe0f3dc3bc0cc924dc4a9 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Tue, 31 Jan 2012 02:10:05 -0700 Subject: [PATCH] Save SSI on /off Should technically solve #339, but there are probably more instances around the codebase that have the same issue. --- TShockAPI/Commands.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 71594c46..9431886d 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -986,6 +986,18 @@ namespace TShockAPI private static void Off(CommandArgs args) { + + if (TShock.Config.ServerSideInventory) + { + foreach (TSPlayer player in TShock.Players) + { + if (player != null && player.IsLoggedIn && !player.IgnoreActionsForClearingTrashCan) + { + TShock.InventoryDB.InsertPlayerData(player); + } + } + } + TShock.Utils.ForceKickAll("Server shutting down!"); WorldGen.saveWorld(); Netplay.disconnect = true;