private List<Interaction> GetInteractions(Character character) { List<Interaction> interactions = new List<Interaction>(); foreach (MailMessages.Message message in character.GetMailMessages().Result.Messages) { if (message.SenderId.Equals(character.CharacterId)) { interactions.AddRange(ToCharacters(message.ToCharacterIds).Select(c => new MailInteraction { PrimaryCharacter = new CharacterData(character), SecondaryCharacter = c, Subject = message.Title, Body = GetBody(message), Time = message.SentDate })); } else { interactions.Add(new MailInteraction { PrimaryCharacter = new CharacterData {ID = message.SenderId, Name = message.SenderName}, SecondaryCharacter = new CharacterData(character), Subject = message.Title, Body = GetBody(message), Time = message.SentDate }); } } return interactions; }
public CharacterData(Character character) { Name = character.CharacterName; ID = character.CharacterId; Corporation = new CorporationData {Name = character.CorporationName, ID = character.CorporationId}; Corporation.alliance = new AllianceData {Name = character.AllianceName, ID = character.AllianceId}; }
private List<Interaction> GetInteractions(Character character) { List<Interaction> interactions = new List<Interaction>(); WalletJournal tempJournal = character.GetWalletJournal(2560, 0L).Result; int entries = tempJournal.Journal.Count; while (entries > 0) { long id = tempJournal.Journal.Min(x => x.RefId); // WalletJournal TypeIDs: // 10: Player Donation // 37: Corp Account Withdrawal // 1: Direct Trade interactions.AddRange(GetEntriesById(tempJournal, 10).Select(j => new DonationInteraction { Amount = j.Amount, Time = j.Date, Reason = j.Reason, PrimaryCharacter = new CharacterData {Name = j.OwnerName, ID = j.OwnerId}, SecondaryCharacter = new CharacterData {Name = j.ParticipantName, ID = j.ParticipantId}, ID = j.RefId })); interactions.AddRange(GetEntriesById(tempJournal, 37).Select(j => new CorpDonationInteraction { Amount = j.Amount, Time = j.Date, Reason = j.Reason, PrimaryCharacter = new CharacterData {Name = j.ArgumentName, ID = j.ArgumentId}, SecondaryCharacter = new CharacterData {Name = j.ParticipantName, ID = j.ParticipantId}, Corporation = new CorporationData {Name = j.OwnerName, ID = j.OwnerId}, ID = j.RefId })); interactions.AddRange(GetEntriesById(tempJournal, 1).Select(j => new TradeInteraction { Amount = j.Amount, Time = j.Date, PrimaryCharacter = new CharacterData {Name = j.OwnerName, ID = j.OwnerId}, SecondaryCharacter = new CharacterData {Name = j.ParticipantName, ID = j.ParticipantId}, Location = new StationData {Name = j.ArgumentName, ID = j.ArgumentId}, ID = j.RefId })); tempJournal = character.GetWalletJournal(2560, id).Result; entries = tempJournal.Journal.Count; } return interactions; }
public async Task <WalletTransactions> GetCharacterWallet(long keyid, string vcode, long characterId, long fromid) { _logger.Debug("{method} {keyid} {characterid} {fromid}", "GetCharacterWallet", keyid, characterId, fromid); try { var entity = new eZet.EveLib.EveXmlModule.Character((int)keyid, vcode, characterId); var z = await entity.GetWalletTransactionsAsync(2560, fromid); return(z.Result); } catch (Exception e) { if (e.ToString().Contains("Authentication failure")) { throw new UserException(strings.ErrorAuthenticationFailure, e); } _logger.Error("{method} {@exception}", "GetCharacterWalletBackground", e); throw new UserException(strings.ErrorCallingEveApi, e); } }
public WalletAnalyzer(Character character) { Characters = new List<Character> {character}; Interactions = new HashSet<Interaction>(); }
public Character_StaticDeserializationTests() { _character = new Character(new CharacterKey(0, ""), 0); _character.RequestHandler = new StaticXmlRequestHandler(new XmlSerializer()); }