Наследование: Terraria.Main
Пример #1
0
        internal static void Launch()
        {
            using (var m = new TMain())
            {
                SocialAPI.Initialize(SteamExists() ? SocialMode.Steam : SocialMode.None);
                PrismDebug.Init();

                try
                {
                    m.Run();
                }
                catch (Exception e)
                {
                    ExceptionHandler.HandleFatal(e, false);
                }
            }
        }
Пример #2
0
        internal static int Launch(string[] args)
        {
            try
            {
                ReadCommandLineArgs(CommandLineArgs.Parse(args, ShortToLongArgs));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("An error occured during command-line argument parsing:");
                Console.Error.WriteLine(e);

                return(ExceptionHandler.GetHResult(e));
            }

            using (var m = new TMain())
            {
                SocialAPI.Initialize(SteamExists() ? SocialMode.Steam : SocialMode.None);
                LaunchInitializer.LoadParameters(m);

                PrismDebug.Init();

                try
                {
                    T.Main.OnEngineLoad += () =>
                    {
                        T.Program.StartForceLoad();

                        ////TODO: move this to another thread (in StartForceLoad)
                        // not really needed, prism is quite small, compared to terraria (and it doesn't have any HUGE methods ;) )
#if !DEV_BUILD
                        //T.Program.ForceLoadAssembly(Assembly.GetExecutingAssembly() /* Prism */, true);
#endif
                    };

                    m.Run();
                }
                catch (Exception e)
                {
                    ExceptionHandler.HandleFatal(e, false);
                }
            }

            return(0);
        }
Пример #3
0
        internal static int Launch(string[] args)
        {
            try
            {
                ReadCommandLineArgs(CommandLineArgs.Parse(args, ShortToLongArgs));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("An error occured during command-line argument parsing:");
                Console.Error.WriteLine(e);

                return ExceptionHandler.GetHResult(e);
            }

            using (var m = new TMain())
            {
                SocialAPI.Initialize(SteamExists() ? SocialMode.Steam : SocialMode.None);
                LaunchInitializer.LoadParameters(m);

                PrismDebug.Init();

                try
                {
                    T.Main.OnEngineLoad += () =>
                    {
                        T.Program.StartForceLoad();

                        ////TODO: move this to another thread (in StartForceLoad)
                        // not really needed, prism is quite small, compared to terraria (and it doesn't have any HUGE methods ;) )
            #if !DEV_BUILD
                        //T.Program.ForceLoadAssembly(Assembly.GetExecutingAssembly() /* Prism */, true);
            #endif
                    };

                    m.Run();
                }
                catch (Exception e)
                {
                    ExceptionHandler.HandleFatal(e, false);
                }
            }

            return 0;
        }
Пример #4
0
        internal static int Launch(string[] args)
        {
            try
            {
                ReadCommandLineArgs(CommandLineArgs.Parse(args, ShortToLongArgs));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("An error occured during command-line argument parsing:");
                Console.Error.WriteLine(e);

                return ExceptionHandler.GetHResult(e);
            }

            using (var m = new TMain())
            {
                SocialAPI.Initialize(SteamExists() ? SocialMode.Steam : SocialMode.None);
                PrismDebug.Init();

                try
                {
                    T.Main.OnEngineLoad += () =>
                    {
                        T.Program.ForceLoadAssembly(typeof(T.Program).Assembly /* Terraria */, true);
            #if !DEV_BUILD
                        T.Program.ForceLoadAssembly(Assembly.GetExecutingAssembly() /* Prism */, true);
            #endif
                    };

                    m.Run();
                }
                catch (Exception e)
                {
                    ExceptionHandler.HandleFatal(e, false);
                }
            }

            return 0;
        }
Пример #5
0
        internal static int Launch(string[] args)
        {
            try
            {
                ReadCommandLineArgs(CommandLineArgs.Parse(args, ShortToLongArgs));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("An error occured during command-line argument parsing:");
                Console.Error.WriteLine(e);

                return(ExceptionHandler.GetHResult(e));
            }

            using (var m = new TMain())
            {
                SocialAPI.Initialize(SteamExists() ? SocialMode.Steam : SocialMode.None);
                PrismDebug.Init();

                try
                {
                    T.Main.OnEngineLoad += () =>
                    {
                        T.Program.ForceLoadAssembly(typeof(T.Program).Assembly /* Terraria */, true);
#if !DEV_BUILD
                        T.Program.ForceLoadAssembly(Assembly.GetExecutingAssembly() /* Prism */, true);
#endif
                    };

                    m.Run();
                }
                catch (Exception e)
                {
                    ExceptionHandler.HandleFatal(e, false);
                }
            }

            return(0);
        }