PID file is now deleted on server shutdown.

Console warning if it was shutdown improperly.
This commit is contained in:
Lucas Nicodemus 2011-07-13 00:56:00 -06:00
parent b242bfde17
commit ec07c38b86

View file

@ -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"));
}
}
/// <summary>