diff --git a/MinecraftServerInfo/Program.cs b/MinecraftServerInfo/Program.cs index fcadef5..fd25cad 100644 --- a/MinecraftServerInfo/Program.cs +++ b/MinecraftServerInfo/Program.cs @@ -11,20 +11,20 @@ namespace MinecraftServerInfo { static void Main(string[] args) { - using (Socket client = new Socket(SocketType.Stream, ProtocolType.Tcp)) + using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) try { //01 00 //0F 00-2F 09 31 32 37 2E 30 2E 30 2E 31 63 DD 01 //client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000); //client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 5000); - //client.Connect("CityCraft.cn", 25565); - client.Connect("four.mengcraft.com", 11133); + client.Connect("CityCraft.cn", 25565); + //client.Connect("four.mengcraft.com", 11133); Console.WriteLine("开始连接"); if (client.Connected) { Console.WriteLine("发送数据"); - client.Send(new byte[] { 0x0F, 0x00, 0x2F, 0x09, 0x31, 0x32, 0x37, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x31, 0x63, 0xDD, 0x01 }); + client.Send(new byte[] { 0x0F, 0x00, 0x04, 0x09, 0x31, 0x32, 0x37, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x31, 0x63, 0xDD, 0x01 }); client.Send(new byte[] { 0x01, 0x00 }); Console.WriteLine("读取头数据"); byte[] header = new byte[5];