Beispiel #1
0
        public async Task <CurrentGameInfoLive> RetrieveCurrentGameInfo()
        {
            Url url = new Url(UrlConstants.GetBaseUrl(region)).AppendPathSegments(UrlConstants.observerModeRestpart,
                                                                                  "/consumer/getSpectatorGameInfo/", UrlConstants.GetPlatformId(region), id.ToString());

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

            string responseString;

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