示例#1
0
        public static MatchlistDto GetMatchlist(string apiKey, ServiceProxy platformId, string accountId, Champion champion = Champion.ALL, MathmakingQueue queue = MathmakingQueue.ALL, Season season = Season.ALL, long beginTime = default(long), long endTime = default(long), int index = default(int))
        {
            var url = string.Format(UrlSettings.Default.Matchlist, apiKey, platformId, accountId);

            if (champion != Champion.ALL)
            {
                url += $"&champion={(int)champion}";
            }
            if (queue != MathmakingQueue.ALL)
            {
                url += $"&queue={(int)queue}";
            }
            if (season != Season.ALL)
            {
                url += $"&season={(int)season}";
            }
            if (endTime != default(long))
            {
                url += $"&endTime={endTime}";
            }
            if (beginTime != default(long))
            {
                url += $"&beginTime={beginTime}";
            }
            url += $"&endIndex={index + 100 - 1}";
            url += $"&beginIndex={index}";

            RiotDispatcher.Sleep();

            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <MatchlistDto>(url, headers));
        }
示例#2
0
        public static ChattersDto GetChatters(string channel)
        {
            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <ChattersDto>($"http://tmi.twitch.tv/group/user/{channel}/chatters", headers));
        }
示例#3
0
        public static ChannelDto GetChannel(string channel, string clientId)
        {
            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <ChannelDto>($"https://api.twitch.tv/kraken/channels/{channel}?client_id={clientId}", headers));
        }
示例#4
0
        public static ValidationDto SendAccessToken(string clientId, string accessToken)
        {
            var headers = new Dictionary <string, string>
            {
                { "Authorization", $"OAuth {accessToken}" },
            };

            return(Ajax.Get <ValidationDto>($"https://id.twitch.tv/oauth2/validate", headers));
        }
示例#5
0
        public static SummonerDto GetSummonerByAccount(string apiKey, ServiceProxy platformId, string accountId)
        {
            var url = string.Format(UrlSettings.Default.SummonerByAccount, apiKey, platformId, accountId);

            RiotDispatcher.Sleep();

            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <SummonerDto>(url, headers));
        }
示例#6
0
        public static MatchDto GetMatch(string apiKey, ServiceProxy platformId, long gameId)
        {
            var url = string.Format(UrlSettings.Default.Match, apiKey, platformId, gameId);

            RiotDispatcher.Sleep();

            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <MatchDto>(url, headers));
        }
示例#7
0
        public static SummonerDto GetSummonerByName(string apiKey, ServiceProxy platformId, string summonerName)
        {
            summonerName = HttpUtility.UrlPathEncode(summonerName);
            var url = string.Format(UrlSettings.Default.SummonerByName, apiKey, platformId, summonerName);

            RiotDispatcher.Sleep();

            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <SummonerDto>(url, headers));
        }
示例#8
0
        public static CurrentGameInfoDto GetCurrentGame(string apiKey, ServiceProxy platformId, string summonerName)
        {
            var summoner = Riot.GetSummonerByName(apiKey, platformId, summonerName);
            var url      = string.Format(UrlSettings.Default.CurrentGame, apiKey, platformId, summoner.id);

            RiotDispatcher.Sleep();

            var headers = new Dictionary <string, string>
            {
            };

            return(Ajax.Get <CurrentGameInfoDto>(url, headers));
        }