Ejemplo n.º 1
0
        private string GetKey(GameRegionEnum region)
        {
            var regionKey = Keyifier.GetRegionKey(region);

            return(Keyifier.GetKey("realm", new List <string>()
            {
                regionKey
            }));
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 4
0
        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
            }));
        }
Ejemplo n.º 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
            }));
        }
Ejemplo n.º 6
0
 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.");
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 8
0
 public static string GetRegionKey(GameRegionEnum region)
 {
     return(region.ToString().ToLower());
 }