Beispiel #1
0
        public async Task <IEnumerable <MailBody> > GetMailBodyAsync(CharacterSpecificApiKey apiKey, long messageId)
        {
            var result = await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, EveXmlSpecializedCollectionCacheAgent <MailBodyCollection>, MailBodyCollection>(
                $"{this.Server.XMLApi}char/MailBodies.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}&IDs={messageId}");

            return(result.Items);
        }
Beispiel #2
0
        public async Task <IEnumerable <SkillQueue> > GetSkillQueueAsync(CharacterSpecificApiKey apiKey)
        {
            var result = await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, EveXmlSpecializedCollectionCacheAgent <SkillQueueCollection>, SkillQueueCollection>(
                $"{this.Server.XMLApi}char/SkillQueue.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}");

            return(result.Items);
        }
Beispiel #3
0
        public async Task <IEnumerable <MailMessageItem> > GetMailMessagesAsync(CharacterSpecificApiKey apiKey)
        {
            var result = await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, MailMessageCollection>(
                $"{this.Server.XMLApi}char/MailMessages.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}");

            return(result.Items.Where(x => x.SenderId != apiKey.CharacterId));
        }
Beispiel #4
0
        public async Task <IEnumerable <Notification> > GetNotificationsAsync(CharacterSpecificApiKey apiKey)
        {
            var result = await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, NotificationCollection>(
                $"{this.Server.XMLApi}char/Notifications.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}");

            return(result.Items.Where(x => !x.IsRead));
        }
Beispiel #5
0
        public async Task <double> GetEstimatedCharacterValue(CharacterSpecificApiKey apiKey)
        {
            var characterSheet = await this.GetCharacterSheetAsync <CharacterSheet>(apiKey);

            return((((DateTime.Now - characterSheet.DayOfBirth).TotalDays / 365.2425) * (this.GetItemAveragePrice(29668) / 3)) +
                   (characterSheet.Skills.Sum(x => x.Skillpoints) / 500000 * this.GetItemAveragePrice(40520)));
        }
Beispiel #6
0
        public async Task <ReadOnlyDictionary <long, AssetItem> > GetAssetsAsync(CharacterSpecificApiKey apiKey)
        {
            var result = await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, EveXmlSpecializedCollectionCacheAgent <AssetItem>, AssetItemCollection>(
                $"{this.Server.XMLApi}char/AssetList.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}");

            return(result.Items.ToDictionary(x => x.ItemId).AsReadOnly());
        }
Beispiel #7
0
        public async Task <double> GetEstimatedAssetValue(CharacterSpecificApiKey apiKey)
        {
            await this.CachePriceAsync();

            var assets = await this.GetAssetsAsync(apiKey);

            return(assets
                   .Where(x => !x.Value.IsBlueprintCopy && !x.Value.IsCapsule && !x.Value.IsHiddenModifier && !x.Value.IsSkill)
                   .Select(x => new { Price = this.GetItemPrice(x.Value.TypeId)?.AveragePrice })
                   .Where(x => x.Price.HasValue)
                   .Select(x => x.Price.Value)
                   .Sum(x => x));
        }
Beispiel #8
0
 public async Task <SkillInTraining> GetSkillInTrainingAsync(CharacterSpecificApiKey apiKey)
 {
     return(await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, EveXmlSpecializedCacheAgent <SkillInTraining>, SkillInTraining>(
                $"{this.Server.XMLApi}char/SkillInTraining.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}"));
 }
Beispiel #9
0
 public async Task <T> GetCharacterSheetAsync <T>(CharacterSpecificApiKey apiKey)
     where T : CharacterSheetCompact, new()
 {
     return(await WebServiceConsumer.Consume <DefaultRestClient, XmlDeserializer, EveXmlSpecializedCacheAgent <T>, T>(
                $"{this.Server.XMLApi}char/CharacterSheet.xml.aspx?keyId={apiKey.KeyId}&vCode={apiKey.VerificationCode}&characterID={apiKey.CharacterId}"));
 }