Esempio n. 1
0
 /// <summary>
 /// Returns a champions details JSON string.
 /// </summary>
 /// <param name="id"> The champion ID. </param>
 /// <param name="region"> The region we are looking to grab from. </param>
 /// <returns>cahmpion details json string</returns>
 public static String CHAMPION_STATIC_DATA(int id = 17, ChampData champData = ChampData.minimal, Region.RegionEnum region = Region.RegionEnum.na)
 {
     // EXAMPLE: https;//global.api.pvp.net/api/lol/static-data/na/v1.2/champion/30?api_key=1069372c-3d2d-4734-964c-53434511b8f8
     if (champData == ChampData.minimal)
     {
         return(API_Prefix(region) + "static-data/" + region.ToString() + "/" + "v1.2/champion/" + id.ToString() + "&api_key=" + API_KEY_SUFFIX);
     }
     else
     {
         return(API_Prefix(region) + "static-data/" + region.ToString() + "/" + "v1.2/champion/" + id.ToString() + "?champData=" + champData.ToString() + "&api_key=" + API_KEY_SUFFIX);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// The API prefix for the majority of the API calls.
    /// </summary>
    private static String API_Prefix(Region.RegionEnum region, bool isChampionMastery = false)
    {
        string url = "https://" + region.ToString() + ".api.pvp.net/";

        if (!isChampionMastery)
        {
            url += "api/lol/";
        }

        return(url);
    }
Esempio n. 3
0
    /// <summary>
    /// Returns the API Challenge match list Json String
    /// </summary>
    /// <param name="region">the region we want the matches from</param>
    /// <param name="beginDate"> the begin date we want to look at. Has to be either 0 or 5 minute intervals with no seconds.</param>
    /// <returns> API Challenge match list Json string</returns>
    public static String API_CHALLENGE_MATCH_LIST(Region.RegionEnum region, long beginDate)
    {
        long remainder = (beginDate % 100);

        if (remainder != 0)
        {
            beginDate -= remainder;
        }

        UnityEngine.Debug.Log(beginDate);

        // https;//na.api.pvp.net//api/lol/{region}/v4.1/game/ids?beginDate={beginDate}&api_key=API_KEY_SUFFIX
        return(API_Prefix(region) + region.ToString() + "/" + "v4.1/game/ids?beginDate=" + beginDate + "&api_key=" + API_KEY_SUFFIX);
    }
Esempio n. 4
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="summonerNames"></param>
    /// <param name="region"></param>
    /// <returns></returns>
    public static String SUMMONERIDS_FROM_SUMMONER_NAME(string [] summonerNames, Region.RegionEnum region = Region.RegionEnum.na, string version = "1.4")
    {
        String urlString = API_Prefix(region) + region.ToString() + "/v" + version + "/summoner/by-name/";


        for (int i = 0; i < summonerNames.Length; ++i)
        {
            urlString += summonerNames[i];

            if (!i.Equals(summonerNames.Length - 1))
            {
                urlString += ",";
            }
        }

        return(urlString + "?api_key=" + API_KEY_SUFFIX);
    }
Esempio n. 5
0
 /// <summary>
 /// Return a match with a specified ID in a specified region.
 /// </summary>
 /// <param name="region">the region you wish to retrieve from. </param>
 /// <param name="matchID">the match id of the match you wish to retrieve. </param>
 /// <returns>a matches Json string</returns>
 public static String MATCHv2_2(Region.RegionEnum region, long matchID)
 {
     // "/api/lol/{region}/v2.2/match/{matchID}?api_key=API_KEY_SUFFIX"
     return(API_Prefix(region) + region.ToString() + "/" + "v2.2/match/" + matchID + "?api_key=" + API_KEY_SUFFIX);
 }
Esempio n. 6
0
 /// <summary>
 /// Returns a Champions data Json string. The results depend upon what type of data you are requesting about the champion (See: ChampData)
 /// </summary>
 /// <param name="region"> the region you are looking to retrieve from </param>
 /// <param name="champData">the information about the champion you wish to retrieve. (See: ChampData)</param>
 /// <returns>Champion data Json string</returns>
 public static String CHAMPIONv1_2(Region.RegionEnum region, ChampData champData)
 {
     // https;//global.api.pvp.net/api/lol/static-data/na/v1.2/champion?champData=stats&api_key=API_KEY_SUFFIX
     return(Global_API_Prefix + "static-data/" + region.ToString() + "/" + "v1.2/champion?champData=" + champData.ToString() + "&api_key=" + API_KEY_SUFFIX);
 }