Ejemplo n.º 1
0
        public IActionResult GetPlayerAchievements(string userid, string appid)
        {
            WebClient webClient = new WebClient();
            string    reqUrl    = SteamUrlBuilders.BuildGetPlayerAchievementsForGameRequestUrl(SteamEnums.Methods.GetPlayerAchievements, userid, appid, _apiKeys.SteamApiKey, steamBaseUrl);
            GetPlayerAchievementsResponse jsonResponse =
                JsonConvert.DeserializeObject <GetPlayerAchievementsResponse>(webClient.DownloadString(reqUrl));

            return(Ok(jsonResponse));
        }
Ejemplo n.º 2
0
        public IActionResult GetFriendList(string userid)
        {
            WebClient             webClient    = new WebClient();
            string                reqUrl       = SteamUrlBuilders.BuildGetFriendRequestUrl(SteamEnums.Methods.GetFriendList, userid, _apiKeys.SteamApiKey, steamBaseUrl);
            GetFriendListResponse jsonResponse =
                JsonConvert.DeserializeObject <GetFriendListResponse>(webClient.DownloadString(reqUrl));

            return(Ok(jsonResponse));
        }
Ejemplo n.º 3
0
        public IActionResult GetOwnedGames(string userid)
        {
            WebClient webClient = new WebClient();
            string    reqUrl    = SteamUrlBuilders.BuildPlayerServiceRequestUrl(SteamEnums.Methods.GetOwnedGames, userid, _apiKeys.SteamApiKey, steamBaseUrl);

            _logger.LogInformation($"Sending request to {reqUrl}");
            string jsonResponse = webClient.DownloadString(reqUrl);

            _logger.LogInformation($"Response got: {jsonResponse}");
            GetOwnedGameResponse ownedGames = JsonConvert.DeserializeObject <GetOwnedGameResponse>(jsonResponse);

            return(Ok(ownedGames));
        }