Exemple #1
0
        // See MainPatcher.Patch()...

        //public override bool IsChatAllowedHook()
        //{
        //    return base.IsChatAllowedHook();
        //}

        //public override bool PlayerChatLocalHook()
        //{
        //    return base.PlayerChatLocalHook();
        //}

        protected override void Update(GameTime gt)
        {
            try
            {
                ElapsedTime = (float)gt.ElapsedGameTime.TotalSeconds;

                HookManager.GameBehaviour.PreUpdate();

                ApplyHotfixes(); //The array is initialized every time new Player() is called. Until we have like InitPlayer or something we just have to ghettohack it like this.

                base.Update(gt);

                HookManager.GameBehaviour.UpdateDebug();

                if (!gameMenu && prevGameMenu)
                {
                    Helpers.Main.RandColorText("Welcome to " + PrismApi.NiceVersionString + ".", true);
                }

                HookManager.GameBehaviour.PostUpdate();

                PrismDebug.Update();
            }
            catch (Exception e)
            {
                ExceptionHandler.Handle(e);
            }

            prevGameMenu = gameMenu;
        }
Exemple #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);
        }
Exemple #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);
                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);
        }