Exemple #1
0
        public async Task <IndustryJobs> GetIndustryJobs(ApiKey key, ApiKeyEntity entity)
        {
            var character = new Character(key.ApiKeyId, key.VCode, entity.EntityId);
            var result    = (await character.GetIndustryJobsAsync().ConfigureAwait(false)).Result;

            return(result);
        }
Exemple #2
0
        private static async Task <IList <JournalEntry> > getJournalEntriesAsync(ApiKey key, ApiKeyEntity apiKeyEntity,
                                                                                 int rowLimit,
                                                                                 long limitId = 0)
        {
            var       list   = new List <JournalEntry>();
            var       ckey   = await new CharacterKey(key.ApiKeyId, key.VCode).InitAsync().ConfigureAwait(false);
            Character entity = ckey.Characters.Single(c => c.CharacterId == apiKeyEntity.EntityId);
            var       res    = await entity.GetWalletJournalAsync(rowLimit).ConfigureAwait(false);

            while (res.Result.Journal.Count > 0)
            {
                var sortedList = res.Result.Journal.OrderByDescending(f => f.RefId);
                foreach (var entry in sortedList)
                {
                    if (entry.RefId == limitId)
                    {
                        return(list);
                    }
                    var newEntry = new JournalEntry();
                    newEntry.ApiKeyEntity_Id = apiKeyEntity.Id;
                    list.Add(ApiEntityMapper.Map(entry, newEntry));
                }
                try {
                    res =
                        await entity.GetWalletJournalAsync(rowLimit, sortedList.Last().RefId).ConfigureAwait(false);
                } catch (Exception) {
                    return(list);
                }
            }
            return(list);
        }
Exemple #3
0
        private static async Task <IList <Transaction> > getTransactionsAsync(ApiKey key, ApiKeyEntity apiKeyEntity, int rowLimit,
                                                                              long limitId = 0)
        {
            var       transactions = new List <Transaction>();
            var       ckey         = await new CharacterKey(key.ApiKeyId, key.VCode).InitAsync().ConfigureAwait(false);
            Character entity       = ckey.Characters.Single(c => c.CharacterId == apiKeyEntity.EntityId);
            EveApiResponse <WalletTransactions> res = await entity.GetWalletTransactionsAsync(rowLimit).ConfigureAwait(false);

            while (res.Result.Transactions.Count > 0)
            {
                IOrderedEnumerable <WalletTransactions.Transaction> sortedList =
                    res.Result.Transactions.OrderByDescending(f => f.TransactionId);
                foreach (WalletTransactions.Transaction transaction in sortedList)
                {
                    if (transaction.TransactionId == limitId)
                    {
                        return(transactions);
                    }
                    var newTransaction = new Transaction();
                    newTransaction.ApiKeyEntity_Id = apiKeyEntity.Id;
                    transactions.Add(ApiEntityMapper.Map(transaction, newTransaction));
                }

                res = entity.GetWalletTransactions(rowLimit, sortedList.Last().TransactionId);
            }
            return(transactions);
        }
Exemple #4
0
        public async Task <AssetList> GetAssetsAsync(ApiKey key, ApiKeyEntity entity)
        {
            var       data      = new CharacterData();
            var       ckey      = await new CharacterKey(key.ApiKeyId, key.VCode).InitAsync().ConfigureAwait(false);
            Character character = ckey.Characters.Single(c => c.CharacterId == entity.EntityId);
            var       assets    = await character.GetAssetListAsync().ConfigureAwait(false);

            return(assets.Result);
        }
Exemple #5
0
        public CharacterData GetCharacterData(ApiKey key, ApiKeyEntity entity)
        {
            var       data      = new CharacterData();
            var       ckey      = new CharacterKey(key.ApiKeyId, key.VCode);
            Character character = ckey.Characters.Single(c => c.CharacterId == entity.EntityId);
            EveApiResponse <CharacterInfo> info = character.GetCharacterInfo();

            return(data);
        }
Exemple #6
0
        public IList <ApiKeyEntity> GetApiKeyEntities(ApiKey key)
        {
            var ckey = new CharacterKey(key.ApiKeyId, key.VCode);
            var list = new List <ApiKeyEntity>();

            foreach (Character c in ckey.Characters)
            {
                list.Add(ApiEntityMapper.Map(c, new ApiKeyEntity()));
            }
            return(list);
        }
Exemple #7
0
 public Task <IList <JournalEntry> > GetAllJournalEntriesAsync(ApiKey key, ApiKeyEntity entity,
                                                               Func <JournalEntry> transactionFactory)
 {
     return(getJournalEntriesAsync(key, entity, 2560));
 }
Exemple #8
0
 public Task <IList <JournalEntry> > GetNewJournalEntriesAsync(ApiKey key, ApiKeyEntity entity, long latestId)
 {
     return(getJournalEntriesAsync(key, entity, 2560, latestId));
 }
Exemple #9
0
 public Task <IList <Transaction> > GetAllTransactionsAsync(ApiKey key, ApiKeyEntity entity,
                                                            Func <Transaction> transactionFactory)
 {
     return(getTransactionsAsync(key, entity, 2560));
 }
Exemple #10
0
 public Task <IList <Transaction> > GetNewTransactionsAsync(ApiKey key, ApiKeyEntity entity, long latestId)
 {
     return(getTransactionsAsync(key, entity, 2560, latestId));
 }
Exemple #11
0
        public async Task <MarketOrders> GetMarketOrdersAsync(ApiKey activeKey, ApiKeyEntity apiKeyEntity)
        {
            var entity = new Character(activeKey.ApiKeyId, activeKey.VCode, apiKeyEntity.EntityId);

            return((await entity.GetMarketOrdersAsync()).Result);
        }