static void Main(string[] args) { LoadConfig(); if (GetConfigString("Debug/console") == "true") { DashCMD.Start(true); DashCMD.Listen(true); DashCMD.WriteStandard("Loaded config '{0}'", ConfigFile.Name); } ProgramExceptionHandler.RunMainWithHandler(tryAction: () => { ConfigSection gfx = GetConfigSection("Graphics"); if (gfx == null) { DashCMD.WriteError("[game.cfg] Graphics section was not found!"); } GraphicsOptions options = gfx != null ? GraphicsOptions.Init(gfx) : null; using (MainWindow window = new MainWindow(options)) window.Run(60); }, finallyAction: DashCMD.Stop, shutdownAction: () => { }); }
static void Main(string[] args) { DashCMD.Start(); DashCMD.Title = "Ace Of Spades Server"; DashCMD.WriteLine("Game Version: {0}", ConsoleColor.Magenta, GameVersion.Current); SimulatedGame game = null; ProgramExceptionHandler.RunMainWithHandler( () => // tryAction { LoadServerConfig(); game = new ServerGame(); game.Start("AOSServer Game Thread"); DashCMD.Listen(false); }, () => // finallAyction { DashCMD.Stop(); }, () => // shutdownAction { if (game.IsRunning) { game.Stop(); } Console.WriteLine("Press any key to exit..."); Console.ReadKey(); }); }
static void Main(string[] args) { DashCMD.Start(); DashCMD.Listen(true); ProgramExceptionHandler.RunMainWithHandler( () => { using (MainWindow window = new MainWindow()) window.Run(60); }, //try () => { DashCMD.Stop(); }, //finally () => { } //shutdown action ); }
static int Main() { DashCMD.Start(); DashCMD.Listen(true); ProgramExceptionHandler.RunMainWithHandler( () => { using (MainWindow window = new MainWindow()) { window.Run(60); } }, () => { DashCMD.Stop(); }, () => { } ); return(0); }