示例#1
0
        public async Task <League> RetrieveChallengerLeague(CreepScore.Region region, GameConstants.Queue queue)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.leagueAPIVersion, UrlConstants.leaguePart).AppendPathSegment("challenger");

            url.SetQueryParams(new
            {
                type    = GameConstants.GetQueue(queue),
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadLeague(JObject.Parse(responseString)));
        }
示例#2
0
        public async Task <ChampionListStatic> RetrieveChampionsData(CreepScore.Region region, StaticDataConstants.ChampData champData, string locale = "", string version = "", bool dataById = false)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.championPart);

            url.SetQueryParams(new
            {
                locale    = locale,
                version   = version,
                dataById  = dataById.ToString(),
                champData = StaticDataConstants.GetChampData(champData),
                api_key   = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadChampionListStatic(JObject.Parse(responseString)));
        }
示例#3
0
        public async Task <RuneListStatic> RetrieveRunesData(CreepScore.Region region, StaticDataConstants.RuneListData runeListData, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.runePart);

            url.SetQueryParams(new
            {
                locale       = locale,
                version      = version,
                runeListData = StaticDataConstants.GetRuneListData(runeListData),
                api_key      = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadRuneListStatic(JObject.Parse(responseString)));
        }
示例#4
0
        public static Url UrlBuilder(CreepScore.Region region, string version, string endpoint)
        {
            Url url = new Url(GetBaseUrl(region)).AppendPathSegment(apiLolPart).AppendPathSegment(GetRegion(region)).AppendPathSegment(version)
                      .AppendPathSegment(endpoint);

            return(url);
        }
示例#5
0
        public async Task <List <Champion> > RetrieveChampions(CreepScore.Region region, bool freeToPlay = false)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.championAPIVersion, UrlConstants.championPart);

            url.SetQueryParams(new
            {
                freeToPlay = freeToPlay.ToString(),
                api_key    = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadChampions(JObject.Parse(responseString)));
        }
示例#6
0
        public async Task <SummonerSpellStatic> RetrieveSummonerSpellData(CreepScore.Region region, int id, StaticDataConstants.SpellData spellData, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.summonerSpellPart).AppendPathSegment(id.ToString());

            url.SetQueryParams(new
            {
                locale    = locale,
                version   = version,
                spellData = StaticDataConstants.GetSpellData(spellData),
                api_key   = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadSummonerSpellStatic(JObject.Parse(responseString)));
        }
        /// <summary>
        /// Reads data from a file and returns it. If the file doesn't exist it creates the file and retrieves the data. Doesn't contain data by ID field
        /// </summary>
        /// <typeparam name="T1">The object type to return</typeparam>
        /// <typeparam name="T2">The data section enum</typeparam>
        /// <param name="region">The region to load information from</param>
        /// <param name="data">The object we should store the loaded data in</param>
        /// <param name="staticDataType">The data section we should load</param>
        /// <param name="localFolder">The folder the file resides in</param>
        /// <param name="fileName">The filename</param>
        /// <param name="loadFunction"></param>
        /// <param name="retrieveFunction"></param>
        /// <param name="locale">The locale we should use</param>
        /// <param name="version">The patch number we should load data from</param>
        /// <returns>Returns the object (T1) with loaded data</returns>
        async Task <T1> ReadAndLoadData <T1, T2>(CreepScore.Region region,
                                                 T1 data,
                                                 T2 staticDataType,
                                                 StorageFolder localFolder,
                                                 string fileName,
                                                 Func <JObject, T1> loadFunction,
                                                 Func <CreepScore.Region, T2, string, string, Task <T1> > retrieveFunction, string locale = "", string version = "")
        {
            StorageFile file;

#if WINDOWS_APP
            file = await localFolder.TryGetItemAsync(fileName) as StorageFile;
#endif
#if WINDOWS_PHONE_APP
            file = await AppConstants.TryGetItemAsync(localFolder, fileName);
#endif

            // look for the specified file
            if (file != null)
            {
                // if the file is there read it and load the data from it
                string fileString = await FileIO.ReadTextAsync(file);

                JObject fileObject = JObject.Parse(fileString);
                data = loadFunction(fileObject);
                return(data);
            }
            else
            {
                data = await CreateData <T1, T2>(region, data, staticDataType, localFolder, file, fileName, retrieveFunction);

                return(data);
            }
        }
        /// <summary>
        /// Overwrites a file with newly retrieved data. Doesn't contain data by ID field
        /// </summary>
        /// <typeparam name="T1">The object type to return</typeparam>
        /// <typeparam name="T2">The data section enum</typeparam>
        /// <param name="region">The region to load information from</param>
        /// <param name="data">The object we should store the loaded data in</param>
        /// <param name="staticDataType">The data section we should load</param>
        /// <param name="localFolder">The folder the file resides in</param>
        /// <param name="fileName">The filename</param>
        /// <param name="loadFunction"></param>
        /// <param name="retrieveFunction"></param>
        /// <param name="locale">The locale we should use</param>
        /// <param name="version">The patch number we should load data from</param>
        /// <returns>Returns the object (T1) with loaded data</returns>
        async Task <T1> ReadAndOverwriteData <T1, T2>(CreepScore.Region region,
                                                      T1 data,
                                                      T2 staticDataType,
                                                      StorageFolder localFolder,
                                                      string fileName,
                                                      Func <CreepScore.Region, T2, string, string, Task <T1> > retrieveFunction, string locale = "", string version = "")
        {
            StorageFile file;

#if WINDOWS_APP
            file = await localFolder.TryGetItemAsync(fileName) as StorageFile;
#endif
#if WINDOWS_PHONE_APP
            file = await AppConstants.TryGetItemAsync(localFolder, fileName);
#endif

            // look for the specified file
            if (file != null)
            {
                data = await OverwriteData <T1, T2>(region, data, staticDataType, localFolder, file, fileName, retrieveFunction);

                return(data);
            }
            else
            {
                data = await CreateData <T1, T2>(region, data, staticDataType, localFolder, file, fileName, retrieveFunction);

                return(data);
            }
        }
示例#9
0
        public async Task <MatchDetailAdvanced> RetrieveMatch(CreepScore.Region region, long matchId, bool includeTimeline = false)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.matchAPIVersion, UrlConstants.matchPart)
                      .AppendPathSegment(matchId.ToString());

            url.SetQueryParams(new
            {
                includeTimeline = includeTimeline.ToString(),
                api_key         = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadMatchDetailAdvanced(JObject.Parse(responseString)));
        }
示例#10
0
        public async Task <List <Summoner> > RetrieveSummoners(CreepScore.Region region, List <long> summonerIds)
        {
            string ids = "";

            if (summonerIds.Count > 40)
            {
                throw new CreepScoreException("Cannot retrieve more than 40 summoners at once.");
            }

            for (int i = 0; i < summonerIds.Count; i++)
            {
                if (i != summonerIds.Count - 1)
                {
                    ids += summonerIds[i].ToString() + ",";
                }
                else
                {
                    ids += summonerIds[i].ToString();
                }
            }

            Uri uri;

            if (ids != "")
            {
                Url url = UrlConstants.UrlBuilder(region, UrlConstants.summonerAPIVersion, UrlConstants.summonerPart)
                          .AppendPathSegment(ids);
                url.SetQueryParams(new
                {
                    api_key = apiKey
                });
                uri = new Uri(url.ToString());
            }
            else
            {
                throw new CreepScoreException("Cannot have an empty list of summoner IDs.");
            }

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            List <Summoner> summoners           = new List <Summoner>();
            Dictionary <string, JObject> values = JsonConvert.DeserializeObject <Dictionary <string, JObject> >(responseString);

            foreach (KeyValuePair <string, JObject> value in values)
            {
                summoners.Add(new Summoner(value.Value, region));
            }
            return(summoners);
        }
示例#11
0
        private async void summonerSearchBox_KeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                if (summonerSearchBox.Text == "")
                {
                    return;
                }

                summonerSearchBox.IsEnabled       = false;
                searchingForSummonerRing.IsActive = true;
                //heroName.Focus(FocusState.Programmatic);
                string            summonerName = summonerSearchBox.Text;
                CreepScore.Region region       = (CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex);

                Summoner summoner = await AppConstants.creepScore.RetrieveSummoner(region, summonerName);

                if (summoner == null)
                {
                    searchingForSummonerRing.IsActive = false;
                    if (AppConstants.creepScore.ErrorString == "404")
                    {
                        errorTextBlock.Text       = "Cannot find summoner";
                        errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    else if (AppConstants.creepScore.ErrorString == "401")
                    {
                        errorTextBlock.Text       = "Unauthorized";
                        errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    else if (AppConstants.creepScore.ErrorString == "429")
                    {
                        errorTextBlock.Text       = "Rate limit exceeded";
                        errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    else if (AppConstants.creepScore.ErrorString == "500")
                    {
                        errorTextBlock.Text       = "Internal Riot server error";
                        errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    else if (AppConstants.creepScore.ErrorString == "503")
                    {
                        errorTextBlock.Text       = "Riot service unavalible";
                        errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    summonerSearchBox.IsEnabled = true;
                }
                else
                {
                    searchingForSummonerRing.IsActive = false;
                    List <object> parameters = new List <object>();
                    parameters.Add(summoner);
                    Frame.Navigate(typeof(SummonerPage), parameters);
                }
            }
        }
示例#12
0
 /// <summary>
 /// Full summoner constructor
 /// </summary>
 /// <param name="summonerO">JObject representing summoner</param>
 public Summoner(JObject summonerO, CreepScore.Region region)
 {
     id               = (long)summonerO["id"];
     name             = (string)summonerO["name"];
     profileIconId    = (int)summonerO["profileIconId"];
     revisionDateLong = (long)summonerO["revisionDate"];
     SetRevisionDate(revisionDateLong);
     summonerLevel = (long)summonerO["summonerLevel"];
     this.region   = region;
 }
示例#13
0
 /// <summary>
 /// Full summoner constructor
 /// </summary>
 /// <param name="summonerO">JObject representing summoner</param>
 public Summoner(JObject summonerO, CreepScore.Region region)
 {
     id = (long)summonerO["id"];
     name = (string)summonerO["name"];
     profileIconId = (int)summonerO["profileIconId"];
     revisionDateLong = (long)summonerO["revisionDate"];
     SetRevisionDate(revisionDateLong);
     summonerLevel = (long)summonerO["summonerLevel"];
     isLittleSummoner = false;
     this.region = region;
 }
示例#14
0
        public async Task <Dictionary <string, Team> > RetrieveTeam(CreepScore.Region region, List <string> teamIds)
        {
            string ids = "";

            if (teamIds.Count > 10)
            {
                throw new CreepScoreException("Cannot retrieve more than 10 teams at once.");
            }

            for (int i = 0; i < teamIds.Count; i++)
            {
                if (i != teamIds.Count - 1)
                {
                    ids += teamIds[i] + ",";
                }
                else
                {
                    ids += teamIds[i];
                }
            }

            Uri uri;

            if (ids != "")
            {
                Url url = UrlConstants.UrlBuilder(region, UrlConstants.teamAPIVersion, UrlConstants.teamPart)
                          .AppendPathSegment(ids);
                url.SetQueryParams(new
                {
                    api_key = apiKey
                });
                uri = new Uri(url.ToString());
            }
            else
            {
                throw new CreepScoreException("Cannot have an empty list of team IDs.");
            }

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadTeam(responseString));
        }
示例#15
0
        async Task <T1> CreateData <T1, T2>(CreepScore.Region region,
                                            T1 data,
                                            T2 staticDataType,
                                            StorageFolder localFolder,
                                            StorageFile file,
                                            string fileName,
                                            Func <CreepScore.Region, T2, string, string, Task <T1> > retrieveFunction, string locale = "", string version = "")
        {
            // create file
            file = await CreateFile(fileName, localFolder, file);

            data = await OverwriteData <T1, T2>(region, data, staticDataType, localFolder, file, fileName, retrieveFunction);

            return(data);
        }
示例#16
0
 public static string GetPlatformId(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return("NA1");
     }
     else if (region == CreepScore.Region.EUW)
     {
         return("EUW1");
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return("EUN1");
     }
     else if (region == CreepScore.Region.BR)
     {
         return("BR1");
     }
     else if (region == CreepScore.Region.LAN)
     {
         return("LA1");
     }
     else if (region == CreepScore.Region.LAS)
     {
         return("LA2");
     }
     else if (region == CreepScore.Region.OCE)
     {
         return("OC1");
     }
     else if (region == CreepScore.Region.KR)
     {
         return("KR");
     }
     else if (region == CreepScore.Region.TR)
     {
         return("TR1");
     }
     else if (region == CreepScore.Region.RU)
     {
         return("RU");
     }
     else
     {
         return("NONE");
     }
 }
示例#17
0
 /// <summary>
 /// Gets the region
 /// </summary>
 /// <param name="region">Region</param>
 /// <returns>Returns a string representing a region</returns>
 public static string GetRegion(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return("na");
     }
     else if (region == CreepScore.Region.EUW)
     {
         return("euw");
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return("eune");
     }
     else if (region == CreepScore.Region.BR)
     {
         return("br");
     }
     else if (region == CreepScore.Region.LAN)
     {
         return("lan");
     }
     else if (region == CreepScore.Region.LAS)
     {
         return("las");
     }
     else if (region == CreepScore.Region.OCE)
     {
         return("oce");
     }
     else if (region == CreepScore.Region.KR)
     {
         return("kr");
     }
     else if (region == CreepScore.Region.TR)
     {
         return("tr");
     }
     else if (region == CreepScore.Region.RU)
     {
         return("ru");
     }
     else
     {
         return("none");
     }
 }
示例#18
0
 /// <summary>
 /// Base url
 /// </summary>
 /// <param name="region">Region data is coming from</param>
 /// <returns>Base url string</returns>
 public static string GetBaseUrl(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return("https://na.api.pvp.net");
     }
     else if (region == CreepScore.Region.EUW)
     {
         return("https://euw.api.pvp.net");
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return("https://eune.api.pvp.net");
     }
     else if (region == CreepScore.Region.BR)
     {
         return("https://br.api.pvp.net");
     }
     else if (region == CreepScore.Region.LAN)
     {
         return("https://lan.api.pvp.net");
     }
     else if (region == CreepScore.Region.LAS)
     {
         return("https://las.api.pvp.net");
     }
     else if (region == CreepScore.Region.OCE)
     {
         return("https://oce.api.pvp.net");
     }
     else if (region == CreepScore.Region.KR)
     {
         return("https://kr.api.pvp.net");
     }
     else if (region == CreepScore.Region.TR)
     {
         return("https://tr.api.pvp.net");
     }
     else if (region == CreepScore.Region.RU)
     {
         return("https://ru.api.pvp.net");
     }
     else
     {
         return("https://global.api.pvp.net");
     }
 }
示例#19
0
        public async Task <Summoner> RetrieveSummoner(CreepScore.Region region, string summonerName)
        {
            List <string> temp = new List <string>();

            temp.Add(summonerName);
            List <Summoner> returnedList;

            try
            {
                returnedList = await RetrieveSummoners(region, temp);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(returnedList[0]);
        }
示例#20
0
        async Task <T1> OverwriteData <T1, T2>(CreepScore.Region region,
                                               T1 data,
                                               T2 staticDataType,
                                               StorageFolder localFolder,
                                               StorageFile file,
                                               string fileName,
                                               Func <CreepScore.Region, T2, string, string, Task <T1> > retrieveFunction, string locale = "", string version = "")
        {
            // load data from API
            Task task = Task.Run(async() => { data = await retrieveFunction(region, staticDataType, locale, version); });

            task.Wait();
            // then write it out to file
            await FileIO.WriteTextAsync(file, data.ToString());

            return(data);
        }
示例#21
0
        public async Task <Dictionary <long, string> > RetrieveSummonerNames(CreepScore.Region region, List <long> summonerIds)
        {
            string summonerIdsPart = "";

            if (summonerIds.Count > 40)
            {
                throw new CreepScoreException("Cannot retrieve more than 40 summoners at once.");
            }

            for (int i = 0; i < summonerIds.Count; i++)
            {
                if (i != summonerIds.Count - 1)
                {
                    summonerIdsPart += summonerIds[i].ToString() + ",";
                }
                else
                {
                    summonerIdsPart += summonerIds[i].ToString();
                }
            }

            Url url = UrlConstants.UrlBuilder(region, UrlConstants.summonerAPIVersion, UrlConstants.summonerPart)
                      .AppendPathSegments(summonerIdsPart, UrlConstants.namePart);

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(JsonConvert.DeserializeObject <Dictionary <long, string> >(responseString));
        }
示例#22
0
        public async Task <RealmStatic> RetrieveRealmData(CreepScore.Region region)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.realmPart);

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadRealmData(JObject.Parse(responseString)));
        }
示例#23
0
        public async Task <List <string> > RetrieveVersions(CreepScore.Region region)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.versionsPart);

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadStrings(JArray.Parse(responseString)));
        }
示例#24
0
        public async Task <LanguageStringsStatic> RetrieveLanguageStrings(CreepScore.Region region, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.languageStringsPart);

            url.SetQueryParams(new
            {
                locale  = locale,
                version = version,
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadLanguageStringsStatic(JObject.Parse(responseString)));
        }
示例#25
0
        public async Task <Champion> RetrieveChampion(CreepScore.Region region, int id)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.championAPIVersion, UrlConstants.championPart).AppendPathSegment(id.ToString());

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadChampion(JObject.Parse(responseString)));
        }
示例#26
0
        public async Task <FeaturedGamesLive> RetrieveFeaturedGames(CreepScore.Region region)
        {
            Url url = new Url(UrlConstants.GetBaseUrl(region)).AppendPathSegments(UrlConstants.observerModeRestpart,
                                                                                  "/featured");

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());
            await CreepScore.GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadFeaturedGames(JObject.Parse(responseString)));
        }
示例#27
0
 /// <summary>
 /// Little summmoner constructor
 /// </summary>
 /// <param name="id">Summoner ID</param>
 /// <param name="name">Summoner Name</param>
 public Summoner(long id, string name, CreepScore.Region region)
 {
     this.id = id;
     this.name = name;
     isLittleSummoner = true;
     this.region = region;
 }
示例#28
0
        async void RefreshStatus(CreepScore.Region region)
        {
            shardStatus = await AppConstants.creepScore.RetrieveShardStatus(region);

            LoadStatus();
        }
示例#29
0
        void LoadVersions(CreepScore.Region region)
        {
            Task task = Task.Run(async() => { AppConstants.versions = await AppConstants.creepScore.RetrieveVersions(region); });

            task.Wait();
        }
示例#30
0
        public async Task <PlayerHistoryAdvanced> RetrieveMatchHistory(CreepScore.Region region, List <int> championIds = null, List <GameConstants.Queue> rankedQueues = null, int?beginIndex = null, int?endIndex = null)
        {
            string url = UrlConstants.GetBaseUrl(region) +
                         UrlConstants.apiLolPart + "/" +
                         UrlConstants.GetRegion(region) +
                         UrlConstants.matchHistoryAPIVersion +
                         UrlConstants.matchHistoryPart + "/" +
                         id.ToString() + "?";

            if (championIds != null)
            {
                if (championIds.Count != 0)
                {
                    url += "championIds=";

                    for (int i = 0; i < championIds.Count; i++)
                    {
                        if (i + 1 == championIds.Count)
                        {
                            url += championIds[i].ToString() + "&";
                        }
                        else
                        {
                            url += championIds[i].ToString() + ",";
                        }
                    }
                }
            }

            if (rankedQueues != null)
            {
                if (rankedQueues.Count != 0)
                {
                    string tmpRankedQueues = "";
                    for (int i = 0; i < rankedQueues.Count; i++)
                    {
                        if (rankedQueues[i] == GameConstants.Queue.None)
                        {
                            continue;
                        }
                        else
                        {
                            if (i + 1 == rankedQueues.Count)
                            {
                                tmpRankedQueues += GameConstants.GetQueue(rankedQueues[i]);
                            }
                            else
                            {
                                tmpRankedQueues += GameConstants.GetQueue(rankedQueues[i]) + ",";
                            }
                        }
                    }
                    if (tmpRankedQueues != "")
                    {
                        url += "rankedQueues=" + tmpRankedQueues + "&";
                    }
                }
            }

            if (beginIndex != null)
            {
                url += "beginIndex=" + beginIndex.Value.ToString() + "&";
            }

            if (endIndex != null)
            {
                url += "endIndex=" + endIndex.Value.ToString() + "&";
            }
            url += "api_key=" +
                   CreepScore.apiKey;

            Uri uri = new Uri(url);

            await CreepScore.GetPermission(region);

            string responseString;

            try
            {
                responseString = await CreepScore.GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadPlayerHistoryAdvanced(JObject.Parse(responseString)));
        }