Пример #1
0
 public async Task LogoutAsync(AutobotBase autobot, TaskContext context)
 {
     if (autobot.IsOnline == true)
     {
         await autobot.LogoutAsync();
     }
 }
Пример #2
0
        public async Task LoginAsync(AutobotBase autobot, TaskContext context)
        {
            if (context.AllowException == false)
            {
                if (autobot.IsOnline == true)
                {
                    return;
                }
                if (autobot.GetService(typeof(IUserCollection)) is IUserCollection userCollection)
                {
                    var autobotUser = await userCollection.GetUserAsync(autobot.AutobotID);

                    var banInfo = autobotUser.BanInfo;
                    if (banInfo.IsBanned == true)
                    {
                        return;
                    }
                }
            }
            try
            {
                await autobot.LoginAsync();
            }
            catch
            {
                autobot.Cancel();
                context.Pop(autobot);
            }
        }
Пример #3
0
 public void Login(AutobotBase autobot, TaskContext context)
 {
     if (autobot.IsOnline == false)
     {
         this.autobots[autobot.Login()] = autobot;
     }
 }
Пример #4
0
 public void Logout(AutobotBase autobot, TaskContext context)
 {
     if (autobot.IsOnline == true && context.IsCompleted(autobot) == true)
     {
         var authentication = context.Authentication;
         autobot.Logout();
         this.autobots.Remove(authentication);
     }
 }
Пример #5
0
 public void Wait(AutobotBase autobot, TaskContext context)
 {
 }