withSIX.Play.Core.Games.Legacy.ServerQuery.SourceServerQuery.GetRules C# (CSharp) Method

GetRules() private method

private GetRules ( ) : Task
return Task
        async Task<byte[]> GetRules() {
            var response = await GetChallengeResponse(0x56).ConfigureAwait(false);
            switch (response[4]) {
            case 0x41: //challenge
                await SendPacket(GetRulesRequestPacket(response.Skip(5).ToArray())).ConfigureAwait(false);
                return await ReceiveTillEnd().ConfigureAwait(false);
            case 0x45: //no challenge needed info
                return response;
            default:
                throw new Exception($"Wrong packet tag: 0x{response[4]:X} Expected: 0x41 or 0x45.");
            }
        }