Example #1
0
 public static void Init()
 {
     try
     {
         GameObjects.Initialize();
         try
         {
             _champion = LoadChampion();
             if (_champion != null)
             {
                 Global.Champion = _champion;
                 if (Global.Reset.Enabled)
                 {
                     Reset.Force(
                         Global.Name, Global.Reset.MaxAge, TargetSelector.Weights.RestoreDefaultWeights);
                 }
                 LeagueSharp.Common.Utility.DelayAction.Add(1000, () => Conflicts.Check(ObjectManager.Player.ChampionName));
                 Update.Check(
                     Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000);
                 Core.Init(_champion, 50);
                 Core.Boot();
             }
         }
         catch (Exception ex)
         {
             Global.Logger.AddItem(new LogItem(ex));
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
        public static void Init()
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException +=
                    delegate(object sender, UnhandledExceptionEventArgs eventArgs)
                {
                    try
                    {
                        var ex = sender as Exception;
                        if (ex != null)
                        {
                            Global.Logger.AddItem(new LogItem(ex));
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                };

                GameObjects.Initialize();

                CustomEvents.Game.OnGameLoad += delegate
                {
                    try
                    {
                        _champion = LoadChampion();
                        if (_champion != null)
                        {
                            Global.Champion = _champion;
                            if (Global.Reset.Enabled)
                            {
                                Reset.Force(
                                    Global.Name, Global.Reset.MaxAge, TargetSelector.Weights.RestoreDefaultWeights);
                            }
                            Utility.DelayAction.Add(1000, () => Conflicts.Check(ObjectManager.Player.ChampionName));
                            Update.Check(
                                Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000);
                            Core.Init(_champion, 50);
                            Core.Boot();
                        }
                    }
                    catch (Exception ex)
                    {
                        Global.Logger.AddItem(new LogItem(ex));
                    }
                };
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }