public async Task LogoutAsync(AutobotBase autobot, TaskContext context) { if (autobot.IsOnline == true) { await autobot.LogoutAsync(); } }
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); } }
public void Login(AutobotBase autobot, TaskContext context) { if (autobot.IsOnline == false) { this.autobots[autobot.Login()] = autobot; } }
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); } }
public void Wait(AutobotBase autobot, TaskContext context) { }