Example #1
0
 public void method_21(object object_0)
 {
     try
     {
         this.method_22();
         string text;
         if (this.process_0 == null)
         {
             MessageBox.Show("can not find process");
             return;
         }
         else if (!TritonHs.smethod_0(this.process_0, Class12.smethod_4, out text))
         {
             Console.WriteLine(text);
             MessageBox.Show("TritonHs.smethod_0 == false");
         }
         else
         {
             TritonHs.Memory.ProcessExited += Class25.Instance.method_1;
             TritonHs.Memory.Executor.FrameDropWaitTime = 15000u;
             TritonHs.Memory.Executor.ExecuteWaitTime   = 15000;
             TritonHs.Memory.DisableCache();
             TritonHs.Memory.ClearCache();
             int version;
             int clientChangelist;
             using (TritonHs.AcquireFrame())
             {
                 version          = Version.version;
                 clientChangelist = Version.clientChangelist;
             }
             if ((long)version != (long)((ulong)Class247.UInt32_1) && (long)clientChangelist != (long)((ulong)Class247.UInt32_2))
             {
                 Console.WriteLine("Hearthstone client version ({0}, {1})", version, clientChangelist);
                 //MainWindow.ilog_0.InfoFormat("Hearthstone client version ({0}, {1})", version, clientChangelist);
                 //new Coroutine(new Func<Task>(Class25.Instance.method_2));
                 smethod_0();
                 //Configuration.Instance.AddSettings(MainSettings.Instance);
                 //Configuration.Instance.AddSettings(DevSettings.Instance);
                 //Configuration.Instance.SaveAll();
                 //base.Dispatcher.Invoke(new Action(this.method_23));
                 //BotManager.PreStart += this.method_11;
                 //BotManager.PostStop += this.method_10;
                 BotManager.Load();
                 this.method_24();
                 this.method_25();
                 //BotManager.OnBotChanged += this.method_6;
                 RoutineManager.Load();
                 this.method_26();
                 this.method_27();
                 //RoutineManager.OnRoutineChanged += this.method_7;
                 //PluginManager.Load();
                 //foreach (IPlugin plugin in PluginManager.Plugins)
                 //{
                 //    if (MainSettings.Instance.EnabledPlugins.Contains(plugin.Name))
                 //    {
                 //        using (TritonHs.AcquireFrame())
                 //        {
                 //            PluginManager.Enable(plugin);
                 //        }
                 //        Thread.Sleep(20);
                 //    }
                 //    else
                 //    {
                 //        using (TritonHs.AcquireFrame())
                 //        {
                 //            PluginManager.Disable(plugin);
                 //        }
                 //        Thread.Sleep(20);
                 //    }
                 //}
                 //this.listBox_0.Dispatcher.Invoke<IEnumerable>(new Func<IEnumerable>(this.method_28), DispatcherPriority.Normal);
                 this.method_29();
                 //PluginManager.PluginEnabled += this.method_5;
                 //PluginManager.PluginDisabled += this.method_4;
                 //MainWindow.ilog_0.ErrorFormat("{0}Please read the following guide before using this program:{0}https://github.com/ChuckHearthBuddy/SilverFish/blob/master/ReadMe.md", Environment.NewLine);
                 //base.Dispatcher.Invoke(new Action(this.method_30));
                 //base.Dispatcher.Invoke(new Action(this.method_31));
                 //this.stopwatch_0.Restart();
                 //RoutineManager.OnRoutineChanged += this.method_7;
                 //BotManager.OnBotChanged += this.method_6;
                 TritonHs.IsBotFullyLoaded = true;
                 Hotkeys.Register("BotManager.StartStop", Keys.S, ModifierKeys.Alt | ModifierKeys.Shift, Class25.Instance.method_3);
                 //if (CommandLine.Arguments.Exists("autostart"))
                 {
                     //var bot = new DefaultBot();
                     //BotManager.CurrentBot = bot;
                     BotManager.Start();
                 }
             }
             else
             {
                 text = string.Format("This client version ({0}, {1}) is unsupported. Hearthbuddy currently supports client version ({2}, {3}). Please check the forums for more information: https://www.thebuddyforum.com/hearthbuddy-forum/", new object[]
                 {
                     version,
                     clientChangelist,
                     Class247.UInt32_1,
                     Class247.UInt32_2
                 });
                 //MainWindow.ilog_0.ErrorFormat(text, Array.Empty<object>());
                 //System.Windows.MessageBox.Show(text, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
                 //base.Dispatcher.BeginInvoke(new Action(base.Close), Array.Empty<object>());
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
         //MainWindow.ilog_0.Error("[OnStartup] A top-level exception has been caught.", exception);
     }
 }