Force terminate.

This commit is contained in:
Sardelka 2022-06-22 10:03:45 +08:00
parent 52a242c72a
commit 8bc5c11030
2 changed files with 10 additions and 3 deletions

View File

@ -37,8 +37,15 @@ namespace RageCoop.Server
{
if (e.SpecialKey == ConsoleSpecialKey.ControlC)
{
e.Cancel = true;
ReadyToStop = true;
if (!ReadyToStop)
{
e.Cancel = true;
ReadyToStop = true;
}
else
{
Environment.Exit(1);
}
}
};

View File

@ -173,7 +173,7 @@ namespace RageCoop.Server
Program.Logger.Warning("Server is shutting down!");
MainNetServer.Shutdown("Server is shutting down!");
Program.Logger.Info("Waiting for resources to stop...");
Program.Logger.Info("Waiting for resources to stop...Press Ctrl+C again to forcibly terminate the program.");
Resources.StopAll();
Program.Logger.Dispose();
}