From ec07c38b863ed2ed26477cc6cde05a381b9de469 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 13 Jul 2011 00:56:00 -0600 Subject: [PATCH] PID file is now deleted on server shutdown. Console warning if it was shutdown improperly. --- TShockAPI/TShock.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 609495bc..9ffc6f33 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -97,6 +97,7 @@ namespace TShockAPI { if (File.Exists(Path.Combine(SavePath, "tshock.pid"))) { + Log.ConsoleInfo("TShock was improperly shut down. Deleting invalid pid file..."); File.Delete(Path.Combine(SavePath, "tshock.pid")); } @@ -195,6 +196,10 @@ namespace TShockAPI NetHooks.GetData -= GetData; NetHooks.GreetPlayer -= OnGreetPlayer; NpcHooks.StrikeNpc -= NpcHooks_OnStrikeNpc; + if (File.Exists(Path.Combine(SavePath, "tshock.pid"))) + { + File.Delete(Path.Combine(SavePath, "tshock.pid")); + } } ///