Esempio n. 1
0
        public static string GetInventorySimpleFromType(RegionData regionData, RiotAuthToken token, string baseUrl, string puuid, string accId, string type, string extra = "")
        {
            if (!string.IsNullOrWhiteSpace(extra))
            {
                extra = "&" + extra;
            }
            var result = RiotWebClient.GetWithBearer(baseUrl + $"/lolinventoryservice/v2/inventories/simple?puuid={puuid}&location={regionData.Servers.DiscoverousServiceLocation}&accountId={accId}&inventoryTypes={type}&signed=true" + extra,
                                                     RiotWebClientUserAgents.Inventory, token.AccessTokenJson.AccessToken,
                                                     "application/json", "application/json");

            return(result.Success ? result.Result : null);
        }
Esempio n. 2
0
        public static RiotLcdsRsoLoginCredentials GetLoginLcdsRsoLoginQueue(RegionData regionData, RiotAuthToken token, string userInfo)
        {
            var result = RiotWebClient.PostWithBearer(regionData.Servers.Lcds.LoginQueueUrl + "/authenticate/RSO",
                                                      RiotWebClientUserAgents.Entitlements, token.AccessTokenJson.AccessToken,
                                                      "application/x-www-form-urlencoded", "application/json", $"userinfo={userInfo}");

            if (result.Success)
            {
                var output = JsonConvert.DeserializeObject <RiotLcdsRsoLoginCredentials>(result.Result);
                output.RsoLoginCredentialsString = result.Result;
                return(output);
            }
            return(null);
        }
Esempio n. 3
0
 /// <summary>
 /// Gets some user info that is needed for <see cref="GetLoginLcdsRsoLoginQueue"/>
 /// </summary>
 /// <param name="token">The result from <see cref="GetLoginToken"/></param>
 /// <param name="config">The OpenId Config from <see cref="GetOpenIdConfig"/> that is used in <see cref="GetLoginToken"/></param>
 /// <returns>The user info as a string</returns>
 public static string GetLoginUserInfo(RiotAuthToken token, RiotAuthOpenIdConfiguration config)
 {
     return(RiotWebClient.GetWithBearer(config.UserinfoEndpoint, RiotWebClientUserAgents.RsoAuth,
                                        token.AccessTokenJson.AccessToken, "application/x-www-form-urlencoded", "application/json").Result);
 }
Esempio n. 4
0
        /// <summary>
        /// Retrieves the entitlements that I have no idea what they do
        /// </summary>
        /// <param name="regionData">The region the player wants to connect to used in <see cref="GetLoginToken"/></param>
        /// <param name="token">The result from <see cref="GetLoginToken"/></param>
        /// <returns></returns>
        public static EntitlementsTokenJson GetLoginEntitlements(RegionData regionData, RiotAuthToken token)
        {
            var result = RiotWebClient.PostWithBearer(regionData.Servers.Entitlements.ExternalUrl,
                                                      RiotWebClientUserAgents.Entitlements, token.AccessTokenJson.AccessToken, "application/json",
                                                      "application/json", "{\r\n    \"urn\": \"urn:entitlement:%\"\r\n}");

            return(result.Success ? JsonConvert.DeserializeObject <EntitlementsTokenJson>(result.Result) : null);
        }
Esempio n. 5
0
        //https://playerpreferences.riotgames.com/playerPref/v3/getPreference/213199017/EUW1/PerksPreferences/?hash=098dcbd9e713bc28cb383642f7d3a7f3a3ae181c6b9787e4734b88a13679e4dd

        public static string GetPlayerPref(RiotAuthToken token, string url, string region, string sumId)
        {
            return(RiotWebClient.GetWithBearer(url.Replace(":443", "") + $"/playerPref/v3/getPreference/{sumId}/{region}/PerksPreferences/", RiotWebClientUserAgents.PlayerPref,
                                               token.AccessTokenJson.AccessToken, "application/json", "application/json").Result);
        }