//private static async Task InitServer() //{ // var server = new DefaultGameServer(); // await Task.CompletedTask; //} //public static void Main(string[] args) //{ // AsyncContext.Run(InitServer); // for (;;) // { // Thread.Sleep(100); // } //} #pragma warning disable RECS0154 // Parameter is never used public static void Main(string[] args) #pragma warning restore RECS0154 // Parameter is never used { Console.WriteLine("Starting listener..."); Server.Start().Wait(); Console.WriteLine("Listening"); Console.CancelKeyPress += Console_CancelKeyPress; GC.Collect(); // This call blocks the main thread until the server is shut down. Engine.GameLoop(); Console.WriteLine("Game loop shut down."); Console.WriteLine("Shutdown complete."); }