Beispiel #1
0
        private string GetKey(GameRegionEnum region)
        {
            var regionKey = Keyifier.GetRegionKey(region);

            return(Keyifier.GetKey("realm", new List <string>()
            {
                regionKey
            }));
        }
        public async Task <IEnumerable <BlizzardPlayer> > GetMembers(GameRegionEnum region, string realmName, string guildName)
        {
            return(await this.cache.GetOrCacheAsync(async() =>
            {
                var result = await this.guildService.GetSlimGuildMembersDataAsync(BlizzardUtilities.GetBlizzardRegionFromEfRegion(region), guildName, realmName);

                return result;
            },
                                                    () => this.GetKey(region, guildName, realmName)));
        }
Beispiel #3
0
        public async Task <BlizzardPlayer> GetPlayer(GameRegionEnum region, string playerName, string realmName)
        {
            return(await this.cache.GetOrCacheAsync(async() =>
            {
                var result = await this.guildService.GetSinglePlayerAsync(BlizzardUtilities.GetBlizzardRegionFromEfRegion(region), realmName, playerName);

                return result;
            },
                                                    () => this.GetKey(region, playerName, realmName)));
        }
        private string GetKey(GameRegionEnum region, string guildName, string realmName)
        {
            var realmKey  = Keyifier.GetRealmKey(realmName);
            var regionKey = Keyifier.GetRegionKey(region);
            var guildKey  = Keyifier.GetGuildKey(guildName);

            return(Keyifier.GetKey("guildmembers", new List <string>()
            {
                regionKey, realmKey, guildKey
            }));
        }
Beispiel #5
0
        private string GetKey(GameRegionEnum region, string playerName, string realmName)
        {
            var realmKey  = Keyifier.GetRealmKey(realmName);
            var regionKey = Keyifier.GetRegionKey(region);
            var guildKey  = Keyifier.GetPlayerKey(playerName);

            return(Keyifier.GetKey("player", new List <string>()
            {
                regionKey, realmKey, guildKey
            }));
        }
 public static BlizzardRegion GetBlizzardRegionFromEfRegion(GameRegionEnum efRegion)
 {
     if (efRegion == GameRegionEnum.EU)
     {
         return(BlizzardRegion.EU);
     }
     else if (efRegion == GameRegionEnum.US)
     {
         return(BlizzardRegion.US);
     }
     throw new ArgumentException("Unrecognized EF region.");
 }
Beispiel #7
0
        public async Task <GuildSlim> GetGuild(GameRegionEnum region, string guildName, string realmName)
        {
            var locatedGuild = await this.cache.GetOrCacheAsync(
                async() =>
            {
                var result = await this.guildService.GetGuild(BlizzardUtilities.GetBlizzardRegionFromEfRegion(region), realmName, guildName);

                return(result);
            },
                () => this.GetKey(region, guildName, realmName));

            return(locatedGuild);
        }
Beispiel #8
0
 public static string GetRegionKey(GameRegionEnum region)
 {
     return(region.ToString().ToLower());
 }