/// <summary> /// fetch matchdata from WebAPI /// </summary> /// <param name="matchId"></param> /// <returns></returns> private Json <Match> FetchMatchdataFromPubgAPI(SelectorMatchId matchId) { try { return(this.apiClient.GetMatch(matchId)); } catch (Exception) { return(null); } }
/// <summary> /// Queries the PUBG-web-api for the match with the given id /// </summary> /// <param name="matchId">Id of the match to be searched for</param> /// <returns>Match with the given match id</returns> public Json <Match> GetMatch(SelectorMatchId matchId) { RestRequest request = this.CreateRequest(new RestRequestSettings() { }); IRestResponse response = this.client.Execute(request); if (response.StatusCode != HttpStatusCode.OK) { throw new RestResponseException(response); } return(new Json <Match>(response.Content)); }