Exemple #1
0
    protected void method_8()
    {
        GClass841 gclass   = this.method_7();
        GClass853 behavior = gclass.GetBehavior();

        while (!behavior.vmethod_19(gclass))
        {
            gclass   = this.iJuHvoQoba0(behavior);
            behavior = gclass.GetBehavior();
        }
        if (!this.Module.GetBehavior().vmethod_19(this.Module))
        {
            this.Module.ForceStop();
        }
        else if (gclass.Priority > this.Module.Priority)
        {
            this.Module.Stop();
        }
        if (this.Module.State == ModuleState.Stopped)
        {
            this.Module = gclass;
        }
        if (this.Module.State == ModuleState.Stopped)
        {
            this.Module.Start();
        }
    }
Exemple #2
0
 public override bool vmethod_19(GClass841 gclass841_0)
 {
     if (!base.Context.Map.Gates.Any <KeyValuePair <int, Gate> >())
     {
         GClass849 gclass = gclass841_0 as GClass849;
         return(gclass != null && gclass.GalaxyGateType == MapUtils.smethod_10(base.C.Map.MapId));
     }
     return(true);
 }
Exemple #3
0
    public void method_9(GClass841 gclass841_1)
    {
        GClass841 module = this.Module;

        if (module != null && module != gclass841_1 && gclass841_1.Priority >= module.Priority && module.State == ModuleState.Stopping && module.IsInterruptible)
        {
            module.ForceStop();
        }
    }
Exemple #4
0
 public GClass837(GClass839 gclass839_1)
 {
     Class13.NP5bWyNzLwONS();
     this.dictionary_0 = new Dictionary <string, DateTimeOffset>();
     this.random_0     = new Random();
     this.list_0       = new List <GClass841>();
     this.object_0     = new object();
     base..ctor();
     this.Context = gclass839_1;
     this.list_0.Add(this.Module = new GClass842(gclass839_1));
     foreach (object obj in Enum.GetValues(typeof(TargetMap)))
     {
         TargetMap targetMap = (TargetMap)obj;
         if (targetMap != TargetMap.PayloadEscort)
         {
             GClass841 gclass = null;
             if (MapUtils.smethod_6((int)targetMap))
             {
                 if (MapUtils.smethod_7((int)targetMap))
                 {
                     gclass = new GClass849(gclass839_1, targetMap);
                 }
                 else if (MapUtils.smethod_8((int)targetMap))
                 {
                     gclass = new GClass850(gclass839_1, targetMap);
                 }
             }
             else
             {
                 gclass = new GClass845(gclass839_1, targetMap);
             }
             if (gclass != null)
             {
                 this.list_0.Add(gclass);
             }
         }
     }
     this.list_0.Add(new GClass843(gclass839_1));
     if (Constants.bool_0)
     {
         this.list_0.Add(new GClass851(gclass839_1));
     }
     this.list_0.Add(new GClass846(gclass839_1));
     if (Constants.FrozenLabirynthEnabled)
     {
         this.list_0.Add(new GClass847(gclass839_1));
     }
     if (Constants.PayloadEscortEnabled)
     {
         this.list_0.Add(new GClass848(gclass839_1));
     }
     this.list_0.Add(new GClass852(gclass839_1));
     this.Module.Start();
 }
Exemple #5
0
    protected GClass841 iJuHvoQoba0(GClass853 gclass853_0)
    {
        int       num    = int.MinValue;
        GClass841 gclass = null;

        foreach (GClass841 gclass2 in this.list_0)
        {
            if (gclass853_0.vmethod_19(gclass2) && (gclass2.Priority > num || gclass == null))
            {
                num    = gclass2.Priority;
                gclass = gclass2;
            }
        }
        return(gclass);
    }
Exemple #6
0
    protected GClass841 method_7()
    {
        int       num    = int.MinValue;
        GClass841 gclass = null;

        foreach (GClass841 gclass2 in this.list_0)
        {
            if (gclass2.Priority > num || gclass == null)
            {
                num    = gclass2.Priority;
                gclass = gclass2;
            }
        }
        return(gclass);
    }
Exemple #7
0
    public virtual void imethod_1(BinaryStream binaryStream_0)
    {
        while (this.vector_0.Length > 0)
        {
            this.vector_0.method_1();
        }
        int i   = 0;
        int num = binaryStream_0.ReadByte();

        while (i < num)
        {
            GClass841 gclass = (GClass841)GClass86.smethod_2((int)binaryStream_0.smethod_1());
            gclass.imethod_1(binaryStream_0);
            this.vector_0.method_0(gclass);
            i++;
        }
    }
Exemple #8
0
 public override bool vmethod_19(GClass841 gclass841_0)
 {
     return(gclass841_0 == this.Module);
 }
Exemple #9
0
 private void method_2()
 {
     for (;;)
     {
         foreach (KeyValuePair <string, GClass871> keyValuePair in this.BotControllers)
         {
             GClass872.< > c__DisplayClass29_0 CS$ < > 8__locals1 = new GClass872.< > c__DisplayClass29_0();
             GClass871 value = keyValuePair.Value;
             CS$ < > 8__locals1.gclass839_0 = ((value != null) ? value.Context : null);
             if (CS$ < > 8__locals1.gclass839_0 != null)
             {
                 GClass872.< > c__DisplayClass29_0 CS$ < > 8__locals2 = CS$ < > 8__locals1;
                 string    str        = "Core-MainBotController-";
                 GClass839 gclass839_ = CS$ < > 8__locals1.gclass839_0;
                 string    str2;
                 if (gclass839_ == null)
                 {
                     str2 = null;
                 }
                 else
                 {
                     AccountSettings account = gclass839_.Account;
                     str2 = ((account != null) ? account.BotId : null);
                 }
                 CS$ < > 8__locals2.logger_0 = LogManager.GetLogger(str + str2);
                 try
                 {
                     bool flag = CS$ < > 8__locals1.gclass839_0.Game.Connection.Socket.method_2();
                     if (CS$ < > 8__locals1.gclass839_0.ShouldBeDisabled && !flag && CS$ < > 8__locals1.gclass839_0.Game.IsLoggedOut)
                     {
                         CS$ < > 8__locals1.gclass839_0.IsEnabled        = false;
                         CS$ < > 8__locals1.gclass839_0.ShouldBeDisabled = false;
                         CS$ < > 8__locals1.gclass839_0.Stop();
                         foreach (GClass841 gclass in CS$ < > 8__locals1.gclass839_0.Scheduler.list_0)
                         {
                             gclass.ForceStop();
                         }
                     }
                     if (CS$ < > 8__locals1.gclass839_0.IsEnabled)
                     {
                         CS$ < > 8__locals1.gclass839_0.Game.Settings.Use3D = true;
                         if (CS$ < > 8__locals1.gclass839_0.LastLogin.Cooldown(60000))
                         {
                             Task loginTask = CS$ < > 8__locals1.gclass839_0.LoginTask;
                             if (loginTask == null || loginTask.IsCompleted)
                             {
                                 CS$ < > 8__locals1.gclass839_0.LoginTask = Task.Run(new Action(CS$ < > 8__locals1.gclass839_0.method_61));
                             }
                         }
                         if (CS$ < > 8__locals1.gclass839_0.Game.IsLoggedIn)
                         {
                             if (CS$ < > 8__locals1.gclass839_0.LastDisconnectReason == ErrorReason.CantLogin)
                             {
                                 CS$ < > 8__locals1.gclass839_0.LastDisconnectReason = ErrorReason.Unknown;
                             }
                             if (CS$ < > 8__locals1.gclass839_0.BackgroundQueue != null && CS$ < > 8__locals1.gclass839_0.BackgroundQueue.Any <Func <DarkOrbitWebAPI, object> >())
                             {
                                 for (;;)
                                 {
                                     GClass872.< > c__DisplayClass29_1 CS$ < > 8__locals3 = new GClass872.< > c__DisplayClass29_1();
                                     CS$ < > 8__locals3.< > c__DisplayClass29_0_0 = CS$ < > 8__locals1;
                                     if (!CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass839_0.BackgroundQueue.TryDequeue(out CS$ < > 8__locals3.func_0))
                                     {
                                         break;
                                     }
                                     Task lastBackgroundAction = CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass839_0.LastBackgroundAction;
                                     if (lastBackgroundAction != null && !lastBackgroundAction.IsCompleted)
                                     {
                                         break;
                                     }
                                     CS$ < > 8__locals3.< > c__DisplayClass29_0_0.gclass839_0.LastBackgroundAction = Task.Run <object>(new Func <object>(CS$ < > 8__locals3.method_0));
                                 }
                             }
                             foreach (GInterface9 ginterface in CS$ < > 8__locals1.gclass839_0.method_59())
                             {
                                 Task lastBackgroundHandlerAction = CS$ < > 8__locals1.gclass839_0.LastBackgroundHandlerAction;
                                 if ((lastBackgroundHandlerAction == null || lastBackgroundHandlerAction.IsCompleted) && ginterface.imethod_0())
                                 {
                                     CS$ < > 8__locals1.gclass839_0.LastBackgroundHandlerAction = Task.Run(new Action(ginterface.Execute));
                                 }
                             }
                             string activeHangarName = CS$ < > 8__locals1.gclass839_0.Game.Web.Equipment.ActiveHangarName;
                             if (!string.IsNullOrWhiteSpace(activeHangarName))
                             {
                                 GClass841 gclass2 = CS$ < > 8__locals1.gclass839_0.Scheduler.method_11();
                                 bool      flag2   = CS$ < > 8__locals1.gclass839_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.gclass839_0.Game.IsLoggedOut && !CS$ < > 8__locals1.gclass839_0.dateTimeOffset_4.Cooldown(900000))
                                     {
                                         flag2 = false;
                                         if (CS$ < > 8__locals1.gclass839_0.Cooldowns.method_2(BotAction.ChangeHangar, 10000.0))
                                         {
                                             bool flag3;
                                             CS$ < > 8__locals1.gclass839_0.method_9 <bool>("ChangeHangar", new Func <DarkOrbitWebAPI, bool>(CS$ < > 8__locals1.method_0), out flag3);
                                         }
                                     }
                                     else
                                     {
                                         flag2 = true;
                                         CS$ < > 8__locals1.gclass839_0.ForceLogout = true;
                                     }
                                 }
                                 if (!flag)
                                 {
                                     if (flag2 && CS$ < > 8__locals1.gclass839_0.LastMapLogin.Cooldown(10000) && CS$ < > 8__locals1.gclass839_0.dateTime_2.Cooldown(1000))
                                     {
                                         CS$ < > 8__locals1.gclass839_0.LastMapLogin           = DateTime.Now;
                                         CS$ < > 8__locals1.gclass839_0.Game.Settings.IsClient = (CS$ < > 8__locals1.gclass839_0.Game.Connection.ProxySocket == null);
                                         CS$ < > 8__locals1.gclass839_0.Game.Start();
                                     }
                                 }
                                 else if (!CS$ < > 8__locals1.gclass839_0.Run)
                                 {
                                     CS$ < > 8__locals1.gclass839_0.Start(true);
                                 }
                             }
                         }
                     }
                 }
Exemple #10
0
 public override bool vmethod_19(GClass841 gclass841_0)
 {
     return(gclass841_0 is GClass848);
 }