mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-19 19:29:15 +12:00
add graceful exit on SIGKILL/SIGTERM
This commit is contained in:
parent
e42b0bf782
commit
ca39f783b9
6 changed files with 15 additions and 7 deletions
|
@ -62,6 +62,8 @@ namespace HISP.Cli
|
|||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
AppDomain.CurrentDomain.ProcessExit += ProcessQuitHandler;
|
||||
|
||||
string BaseDir = Directory.GetCurrentDirectory();
|
||||
Logger.SetCallback(LogStdout);
|
||||
|
||||
|
@ -132,5 +134,10 @@ namespace HISP.Cli
|
|||
shutdownHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
|
||||
shutdownHandle.WaitOne();
|
||||
}
|
||||
|
||||
private static void ProcessQuitHandler(object sender, EventArgs e)
|
||||
{
|
||||
GameServer.ShutdownServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue