Esempio n. 1
0
        /// <inheritdoc/>
        public async Task <List <Rule> > GetRulesAsync()
        {
            if (_currentChallenge == 0)
            {
                await RenewChallengeAsync();
            }

            byte[] response = await SendRequestAsync(
                RequestHelpers.PrepareAS2_GENERIC_Request(RequestHeaders.A2S_RULES, _currentChallenge));

            if (response.Length > 0)
            {
                return(DataResolutionUtils.ExtractListData <Rule>(response));
            }
            else
            {
                throw new InvalidOperationException("Server did not response the query");
            }
        }