Exemplo n.º 1
0
        /// <summary>
        /// Bans a Champion
        /// </summary>
        /// <param name="action">Action Data</param>
        /// <param name="championId">Champion Id</param>
        public async Task BanChampionAsync(Models.ChampSelect.Action action, int championId)
        {
            // Check if request already sent with that action
            if (SentActions.Select(action => action.id).Contains(action.id))
            {
                return;
            }

            var patchActionBody = new
            {
                action.actorCellId,
                championId,
                completed = true,
                action.id,
                isAllyAction = true,
                type         = "ban"
            };

            var queryParameters = Enumerable.Empty <string>();

            try
            {
                await LeagueClient.RequestHandler.GetJsonResponseAsync(HttpMethod.Patch, $"/lol-champ-select/v1/session/actions/{action.id}", queryParameters, patchActionBody);

                Console.WriteLine($"Banned champion with id: " + championId);
                SentActions.Add(action);
            }
            catch (Exception) { }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Bans a Champion
        /// </summary>
        /// <param name="action">Action Data</param>
        /// <param name="championId">Champion Id</param>
        public async Task BanChampionAsync(Models.ChampSelect.Action action, int championId)
        {
            var patchActionBody = new
            {
                action.actorCellId,
                championId,
                completed = true,
                action.id,
                isAllyAction = true,
                type         = "ban"
            };

            var queryParameters = Enumerable.Empty <string>();

            await LeagueClient.RequestHandler.GetJsonResponseAsync(HttpMethod.Patch, $"/lol-champ-select/v1/session/actions/{action.id}", queryParameters, patchActionBody);
        }