mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Replace DnDns with HeijdenDns
HeijdenDns seems to do a better job at querying SRV records
This commit is contained in:
parent
a344ac4101
commit
693073edfc
112 changed files with 5491 additions and 5009 deletions
40
MinecraftClient/Protocol/Dns/Request.cs
Normal file
40
MinecraftClient/Protocol/Dns/Request.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue