public async Task <List <WalletTransactions.Transaction> > GetTransactions(long keyid, string vcode, string characterName, long characterId, DateTime cutoffDate) { _logger.Debug("{method} {keyid}", "EveApi::GetTransactions", keyid); var ck = new eZet.EveLib.EveXmlModule.CharacterKey(keyid, vcode); var character = ck.Characters.FirstOrDefault(x => x.CharacterName == characterName); if (character == null) { throw new UserException(string.Format(strings.ErrorAuthenticationFailureWithKey, keyid)); } var result = new List <WalletTransactions.Transaction>(); long fromid = 0; for (;;) { var partial = await character.GetWalletTransactionsAsync(1000, fromid); var toadd = partial.Result.Transactions.Where(x => x.TransactionDate > cutoffDate); if (toadd.Count() == 0) { break; } _logger.Debug("{method} Got {count} transaction entries", "EveApi::GetTransactions", toadd.Count()); fromid = toadd.Min(x => x.TransactionId); result.AddRange(toadd); } return(result); }
/// <summary> /// Creates a new Character. If the CharacterKey is initialized, the Character will also be initialized with data from /// the Key. /// </summary> /// <param name="apiKey">A valid CharacterKey</param> /// <param name="characterId">A valid Eve Online Character ID</param> public Character(CharacterKey apiKey, long characterId) { Contract.Requires(apiKey != null); ApiKey = apiKey; CharacterId = characterId; if (ApiKey.IsInitialized) ensureInitialized(); }
internal Character(CharacterKey apiKey, ApiKeyInfo.ApiKeyEntity entity) { ApiKey = apiKey; CharacterId = entity.CharacterId; CharacterName = entity.CharacterName; CorporationId = entity.CorporationId; CorporationName = entity.CorporationName; AllianceId = entity.AllianceId; AllianceName = entity.AllianceName; FactionId = entity.FactionId; FactionName = entity.FactionName; BaseUri = apiKey.BaseUri; IsInitialized = true; }
/// <summary> /// Creates a new Character using the provided key data and character id. /// </summary> /// <param name="keyId">Eve API Key ID</param> /// <param name="vCode">Eve API Verification Code (vCode)</param> /// <param name="characterId">Eve Character ID</param> public Character(int keyId, string vCode, long characterId) { ApiKey = new CharacterKey(keyId, vCode); CharacterId = characterId; }
/// <summary> /// Creates a new Character using the provided key data and character id. /// </summary> /// <param name="keyId">Eve API Key ID</param> /// <param name="vCode">Eve API Verification Code (vCode)</param> /// <param name="characterId">Eve Character ID</param> public Character(int keyId, string vCode, long characterId) { ApiKey = new CharacterKey(keyId, vCode); CharacterId = characterId; }