コード例 #1
0
ファイル: Program.cs プロジェクト: staravia/Quaver
        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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Kizuna-dev/QuaverKeymode
        /// <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();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: jaydn/Quaver
        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();
        }