예제 #1
0
 public static Url UrlBuilder(CreepScore.Region region, string version, string endpoint)
 {
     Url url = new Url(GetBaseUrl(region)).AppendPathSegment(apiLolPart).AppendPathSegment(GetRegion(region)).AppendPathSegment(version)
         .AppendPathSegment(endpoint);
     return url;
 }
예제 #2
0
 public static string GetPlatformId(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return "NA1";
     }
     else if (region == CreepScore.Region.EUW)
     {
         return "EUW1";
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return "EUN1";
     }
     else if (region == CreepScore.Region.BR)
     {
         return "BR1";
     }
     else if (region == CreepScore.Region.LAN)
     {
         return "LA1";
     }
     else if (region == CreepScore.Region.LAS)
     {
         return "LA2";
     }
     else if (region == CreepScore.Region.OCE)
     {
         return "OC1";
     }
     else if (region == CreepScore.Region.KR)
     {
         return "KR";
     }
     else if (region == CreepScore.Region.TR)
     {
         return "TR1";
     }
     else if (region == CreepScore.Region.RU)
     {
         return "RU";
     }
     else
     {
         return "NONE";
     }
 }
예제 #3
0
 /// <summary>
 /// Gets the region
 /// </summary>
 /// <param name="region">Region</param>
 /// <returns>Returns a string representing a region</returns>
 public static string GetRegion(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return "na";
     }
     else if (region == CreepScore.Region.EUW)
     {
         return "euw";
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return "eune";
     }
     else if (region == CreepScore.Region.BR)
     {
         return "br";
     }
     else if (region == CreepScore.Region.LAN)
     {
         return "lan";
     }
     else if (region == CreepScore.Region.LAS)
     {
         return "las";
     }
     else if (region == CreepScore.Region.OCE)
     {
         return "oce";
     }
     else if (region == CreepScore.Region.KR)
     {
         return "kr";
     }
     else if (region == CreepScore.Region.TR)
     {
         return "tr";
     }
     else if (region == CreepScore.Region.RU)
     {
         return "ru";
     }
     else
     {
         return "none";
     }
 }
예제 #4
0
 /// <summary>
 /// Base url
 /// </summary>
 /// <param name="region">Region data is coming from</param>
 /// <returns>Base url string</returns>
 public static string GetBaseUrl(CreepScore.Region region)
 {
     if (region == CreepScore.Region.NA)
     {
         return "https://na.api.pvp.net";
     }
     else if (region == CreepScore.Region.EUW)
     {
         return "https://euw.api.pvp.net";
     }
     else if (region == CreepScore.Region.EUNE)
     {
         return "https://eune.api.pvp.net";
     }
     else if (region == CreepScore.Region.BR)
     {
         return "https://br.api.pvp.net";
     }
     else if (region == CreepScore.Region.LAN)
     {
         return "https://lan.api.pvp.net";
     }
     else if (region == CreepScore.Region.LAS)
     {
         return "https://las.api.pvp.net";
     }
     else if (region == CreepScore.Region.OCE)
     {
         return "https://oce.api.pvp.net";
     }
     else if (region == CreepScore.Region.KR)
     {
         return "https://kr.api.pvp.net";
     }
     else if (region == CreepScore.Region.TR)
     {
         return "https://tr.api.pvp.net";
     }
     else if (region == CreepScore.Region.RU)
     {
         return "https://ru.api.pvp.net";
     }
     else
     {
         return "https://global.api.pvp.net";
     }
 }