Esempio n. 1
0
        private void method_3(Action <GClass922> action_0, bool bool_0 = false)
        {
            GClass922 selected = this.Selected;

            if (selected != null && (!bool_0 || selected.Context.Hero.IsInitialized))
            {
                action_0(selected);
            }
        }
Esempio n. 2
0
        private void method_24(object sender, MouseButtonEventArgs e)
        {
            GClass922 selected = this.Selected;

            if (selected != null && selected.Context.Game.Connection.Socket.method_2())
            {
                int config = selected.Context.Hero.Config;
                selected.Context.Server.method_4((config == 1) ? 2 : 1);
                return;
            }
        }
Esempio n. 3
0
 private void method_8(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems == null)
     {
         return;
     }
     foreach (object obj in e.NewItems)
     {
         GClass922 gclass = (GClass922)obj;
         PErkava.smethod_0()[int.Parse(gclass.Context.Account.UserId)] = gclass.Context;
     }
 }
Esempio n. 4
0
        private void method_10()
        {
            try
            {
                MainWindow.< > c__DisplayClass60_0 CS$ < > 8__locals1 = new MainWindow.< > c__DisplayClass60_0();
                CS$ < > 8__locals1.selected = this.Selected;
                if (CS$ < > 8__locals1.selected != null)
                {
                    if (this._lastSelected == CS$ < > 8__locals1.selected && this._lastMapControl != null)
                    {
                        int renders = this.Renders;
                        this.Renders = renders + 1;
                        if (renders % 100 != 0)
                        {
                            goto IL_67;
                        }
                    }
                    this._lastMapControl = GClass6.smethod_0 <MapControl>(this.MainTabs, new Func <MapControl, bool>(CS$ < > 8__locals1.method_0));
IL_67:
                    this._lastSelected = CS$ < > 8__locals1.selected;
                    MapControl lastMapControl = this._lastMapControl;
                    if (lastMapControl != null)
                    {
                        lastMapControl.InvalidateVisual();
                    }
                    GClass922 lastSelected = this._lastSelected;
                    if (lastSelected != null)
                    {
                        GClass890 context = lastSelected.Context;
                        if (context != null)
                        {
                            GClass882 stats = context.Stats;
                            if (stats != null)
                            {
                                stats.method_3();
                            }
                        }
                    }
                    GameManager game = CS$ < > 8__locals1.selected.Context.Game;
                }
            }
            catch
            {
            }
            this.LastRender = DateTimeOffset.Now;
        }
Esempio n. 5
0
    private void method_2()
    {
        DateTimeOffset date = DateTimeOffset.MinValue;

        for (;;)
        {
            foreach (KeyValuePair <string, GClass922> keyValuePair in this.BotControllers)
            {
                GClass923.< > c__DisplayClass29_0 CS$ < > 8__locals1 = new GClass923.< > c__DisplayClass29_0();
                GClass922 value = keyValuePair.Value;
                CS$ < > 8__locals1.gclass890_0 = ((value != null) ? value.Context : null);
                if (CS$ < > 8__locals1.gclass890_0 != null)
                {
                    GClass923.< > c__DisplayClass29_0 CS$ < > 8__locals2 = CS$ < > 8__locals1;
                    string    str        = "Core-MainBotController-";
                    GClass890 gclass890_ = CS$ < > 8__locals1.gclass890_0;
                    string    str2;
                    if (gclass890_ == null)
                    {
                        str2 = null;
                    }
                    else
                    {
                        AccountSettings account = gclass890_.Account;
                        str2 = ((account != null) ? account.BotId : null);
                    }
                    CS$ < > 8__locals2.logger_0 = LogManager.GetLogger(str + str2);
                    try
                    {
                        bool flag = CS$ < > 8__locals1.gclass890_0.Game.Connection.Socket.method_2();
                        if (CS$ < > 8__locals1.gclass890_0.ShouldBeDisabled && !flag && CS$ < > 8__locals1.gclass890_0.Game.IsLoggedOut)
                        {
                            CS$ < > 8__locals1.gclass890_0.IsEnabled        = false;
                            CS$ < > 8__locals1.gclass890_0.ShouldBeDisabled = false;
                            CS$ < > 8__locals1.gclass890_0.Stop();
                            foreach (GClass892 gclass in CS$ < > 8__locals1.gclass890_0.Scheduler.list_0)
                            {
                                gclass.ForceStop();
                            }
                        }
                        if (CS$ < > 8__locals1.gclass890_0.IsEnabled)
                        {
                            CS$ < > 8__locals1.gclass890_0.Game.Settings.Use3D = true;
                            if (CS$ < > 8__locals1.gclass890_0.LastLogin.Cooldown(60000) && date.Cooldown(5000))
                            {
                                Task loginTask = CS$ < > 8__locals1.gclass890_0.LoginTask;
                                if (loginTask == null || loginTask.IsCompleted)
                                {
                                    CS$ < > 8__locals1.gclass890_0.LoginTask = Task.Run(new Action(CS$ < > 8__locals1.gclass890_0.method_63));
                                    date = DateTimeOffset.Now;
                                }
                            }
                            if (CS$ < > 8__locals1.gclass890_0.Game.IsLoggedIn)
                            {
                                if (CS$ < > 8__locals1.gclass890_0.LastDisconnectReason == ErrorReason.CantLogin)
                                {
                                    CS$ < > 8__locals1.gclass890_0.LastDisconnectReason = ErrorReason.Unknown;
                                }
                                if (CS$ < > 8__locals1.gclass890_0.BackgroundQueue != null && CS$ < > 8__locals1.gclass890_0.BackgroundQueue.Any <Func <DarkOrbitWebAPI, object> >())
                                {
                                    for (;;)
                                    {
                                        GClass923.< > c__DisplayClass29_1 CS$ < > 8__locals3 = new GClass923.< > c__DisplayClass29_1();
                                        CS$ < > 8__locals3.< > c__DisplayClass29_0_0 = CS$ < > 8__locals1;
                                        if (!CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass890_0.BackgroundQueue.TryDequeue(out CS$ < > 8__locals3.func_0))
                                        {
                                            break;
                                        }
                                        Task lastBackgroundAction = CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass890_0.LastBackgroundAction;
                                        if (lastBackgroundAction != null && !lastBackgroundAction.IsCompleted)
                                        {
                                            break;
                                        }
                                        CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass890_0.LastBackgroundAction = Task.Run <object>(new Func <object>(CS$ < > 8__locals3.method_0));
                                    }
                                }
                                foreach (GInterface9 ginterface in CS$ < > 8__locals1.gclass890_0.method_61())
                                {
                                    Task lastBackgroundHandlerAction = CS$ < > 8__locals1.gclass890_0.LastBackgroundHandlerAction;
                                    if ((lastBackgroundHandlerAction == null || lastBackgroundHandlerAction.IsCompleted) && ginterface.imethod_0())
                                    {
                                        CS$ < > 8__locals1.gclass890_0.LastBackgroundHandlerAction = Task.Run(new Action(ginterface.Execute));
                                    }
                                }
                                string activeHangarName = CS$ < > 8__locals1.gclass890_0.Game.Web.Equipment.ActiveHangarName;
                                if (!string.IsNullOrWhiteSpace(activeHangarName))
                                {
                                    GClass892 gclass2 = CS$ < > 8__locals1.gclass890_0.Scheduler.method_13();
                                    bool      flag2   = CS$ < > 8__locals1.gclass890_0.IsPaused || gclass2.ShouldBeInGame();
                                    if (activeHangarName != null && gclass2.ShouldChangeHangar(out CS$ < > 8__locals1.string_0) && CS$ < > 8__locals1.string_0 != activeHangarName)
                                    {
                                        if (CS$ < > 8__locals1.gclass890_0.Game.IsLoggedOut && !CS$ < > 8__locals1.gclass890_0.dateTimeOffset_4.Cooldown(900000))
                                        {
                                            flag2 = false;
                                            if (CS$ < > 8__locals1.gclass890_0.Cooldowns.method_2(BotAction.ChangeHangar, 10000.0))
                                            {
                                                bool flag3;
                                                CS$ < > 8__locals1.gclass890_0.method_10 <bool>("ChangeHangar", new Func <DarkOrbitWebAPI, bool>(CS$ < > 8__locals1.method_0), out flag3);
                                            }
                                        }
                                        else
                                        {
                                            flag2 = true;
                                            CS$ < > 8__locals1.gclass890_0.ForceLogout = true;
                                        }
                                    }
                                    if (!flag)
                                    {
                                        if (flag2 && CS$ < > 8__locals1.gclass890_0.LastMapLogin.Cooldown(10000) && CS$ < > 8__locals1.gclass890_0.dateTime_2.Cooldown(1000))
                                        {
                                            CS$ < > 8__locals1.gclass890_0.LastMapLogin           = DateTime.Now;
                                            CS$ < > 8__locals1.gclass890_0.Game.Settings.IsClient = (CS$ < > 8__locals1.gclass890_0.Game.Connection.ProxySocket == null);
                                            CS$ < > 8__locals1.gclass890_0.Game.Start();
                                        }
                                    }
                                    else if (!CS$ < > 8__locals1.gclass890_0.Run)
                                    {
                                        CS$ < > 8__locals1.gclass890_0.Start(true);
                                    }
                                }
                            }
                        }
                    }