Esempio n. 1
0
    public override int UpdatePriority()
    {
        int       result         = base.UpdatePriority();
        GClass923 mainController = base.C.MainController;
        bool?     flag;

        if (mainController == null)
        {
            flag = null;
        }
        else
        {
            Controller parent = mainController.Parent;
            if (parent == null)
            {
                flag = null;
            }
            else
            {
                DopeServiceStatus serviceStatus = parent.ServiceStatus;
                flag = ((serviceStatus != null) ? new bool?(serviceStatus.EnabledGG) : null);
            }
        }
        bool?flag2 = flag;

        if (flag2.GetValueOrDefault() && this.vmethod_0())
        {
            return(result);
        }
        return(int.MinValue);
    }
Esempio n. 2
0
        private async Task method_5()
        {
            DateTimeOffset now        = DateTimeOffset.Now;
            IConnection    connection = this.Connection;
            bool           flag       = connection != null && connection.Connected;

            if (this.dateTimeOffset_0.AddSeconds(5.0) < now && this.Key != null && !this.bool_0 && !flag)
            {
                this.method_7(this.Key);
            }
            if (this.Status == GEnum12.Connected && flag && this.Connection.LastReceived.Cooldown(10000))
            {
                this.Connection.Close();
            }
            else if (this.Status == GEnum12.Connecting && flag && this.dateTimeOffset_2.AddSeconds(5.0) < now)
            {
                this.Connection.Close();
            }
            if ((now - this.dateTimeOffset_1).TotalSeconds > 30.0 && this.Status == GEnum12.Connected && this.Service != null)
            {
                DopeServiceStatus serviceStatus = await this.Service.GetServiceStatus();

                this.ServiceStatus = serviceStatus;
                if (this.ServiceStatus != null)
                {
                    this.dateTimeOffset_1 = now;
                    foreach (string message in this.ServiceStatus.BreakingNews)
                    {
                        Controller.logger_0.Warn(message);
                    }
                    if (this.ServiceStatus.ClientOutOfDate)
                    {
                        Controller.logger_0.Warn("Your client version is outdated. Please download the new version from Home/Downloads.");
                    }
                    if (!this.ServiceStatus.EnabledGG)
                    {
                        Controller.logger_0.Warn("GGs are disabled.");
                    }
                }
            }
        }