mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
40 lines
671 B
C#
40 lines
671 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Heijden.DNS
|
|
{
|
|
public class Request
|
|
{
|
|
public Header header;
|
|
|
|
private List<Question> questions;
|
|
|
|
public Request()
|
|
{
|
|
header = new Header();
|
|
header.OPCODE = OPCode.Query;
|
|
header.QDCOUNT = 0;
|
|
|
|
questions = new List<Question>();
|
|
}
|
|
|
|
public void AddQuestion(Question question)
|
|
{
|
|
questions.Add(question);
|
|
}
|
|
|
|
public byte[] Data
|
|
{
|
|
get
|
|
{
|
|
List<byte> data = new List<byte>();
|
|
header.QDCOUNT = (ushort)questions.Count;
|
|
data.AddRange(header.Data);
|
|
foreach (Question q in questions)
|
|
data.AddRange(q.Data);
|
|
return data.ToArray();
|
|
}
|
|
}
|
|
}
|
|
}
|