private List <string> GetAccountCharactersForMule(MuleAccount account) { var characterNames = account.IncludedCharacters.Select(c => c.ToLower()).ToList(); if (!characterNames.Any()) { var client = new Client(); var connect = client.Connect( _botConfig.Realm, _botConfig.KeyOwner, _botConfig.GameFolder); if (!connect) { return(characterNames); } var characters = client.Login(account.Username, account.Password); if (characters == null) { return(characterNames); } characterNames = characters.Select(c => c.Name.ToLower()).ToList(); client.Disconnect(); } characterNames = characterNames.Except(account.ExcludedCharacters.Select(c => c.ToLower())).ToList(); return(characterNames); }
private static List <Item> GetMuleItems(Client client, MuleAccount muleAccount) { var muleItems = client.Game.Items.Where(i => IsMuleItem(client, i)); if (muleAccount.MatchesAny.Count == 0) { return(muleItems.ToList()); } return(muleItems.Where(i => muleAccount.MatchesAny.Any(f => MatchesRule(i, f))).ToList()); }