public static void Main() { Logger.Initialize(); // Log all unhandled exceptions. AppDomain.CurrentDomain.UnhandledException += (sender, args) => { var exception = args.ExceptionObject as Exception; Logger.Error(exception, LogType.Runtime); }; // Change the working directory to where the executable is. Directory.SetCurrentDirectory(WorkingDirectory); Environment.CurrentDirectory = WorkingDirectory; try { using (var p = Process.GetCurrentProcess()) p.PriorityClass = ProcessPriorityClass.High; } catch (Win32Exception) { /* do nothing */ } CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; NativeAssemblies.Copy(); ConfigManager.Initialize(); SteamManager.Initialize(); using (var game = new QuaverGame()) game.Run(); }
/// <summary> /// Starts the game /// </summary> private static void Run() { Logger.Initialize(); // Log all unhandled exceptions. AppDomain.CurrentDomain.UnhandledException += (sender, args) => { var exception = args.ExceptionObject as Exception; Logger.Error(exception, LogType.Runtime); }; StartIpcServer(); // Change the working directory to where the executable is. Directory.SetCurrentDirectory(WorkingDirectory); Environment.CurrentDirectory = WorkingDirectory; try { using (var p = Process.GetCurrentProcess()) p.PriorityClass = ProcessPriorityClass.High; } catch (Win32Exception) { /* do nothing */ } CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; NativeAssemblies.Copy(); ConfigManager.Initialize(); SteamManager.Initialize(); try { Utils.NativeUtils.RegisterURIScheme("quaver", "Quaver"); } catch (Exception e) { Logger.Error(e, LogType.Runtime); } #if VISUAL_TESTS using (var game = new QuaverGame(new HotLoader("../../../../Quaver.Shared/"))) #else using (var game = new QuaverGame()) #endif game.Run(); }
public static void Main() { // Log all unhandled exceptions. AppDomain.CurrentDomain.UnhandledException += (sender, args) => { var exception = args.ExceptionObject as Exception; Logger.Error(exception, LogType.Runtime); }; // Change the working directory to where the executable is. Directory.SetCurrentDirectory(WorkingDirectory); Environment.CurrentDirectory = WorkingDirectory; CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; ConfigManager.Initialize(); SteamManager.Initialize(); using (var game = new QuaverGame()) game.Run(); }