public static void Main(string[] args) { var serverApp = new GameServerApp(); // start the server serverApp.Start(); // add shutdown hook to close & disconnect the server // gracefully if the application is killed AppDomain.CurrentDomain.ProcessExit += (s, e) => { serverApp.Stop(); Console.WriteLine("Server is terminating."); }; }
public static void Main() { Console.Title = "GW2Emu game server"; GameServerApp serverApp = new GameServerApp(); // register the event handlers serverApp.RegisterHandlers(); // start the server serverApp.Start(); // add shutdown hook to close & disconnect the server // gracefully if the application is killed AppDomain.CurrentDomain.ProcessExit += delegate { serverApp.Stop(); Console.WriteLine("Server is terminating."); }; }