Commit b0348ce2 authored by mercury233's avatar mercury233

get ipv4 only

parent c5d359de
using System.IO; using System.IO;
using System.Linq;
using System.Net; using System.Net;
using System.Text; using System.Text;
using YGOSharp.Network; using YGOSharp.Network;
...@@ -54,7 +55,7 @@ namespace WindBot.Game ...@@ -54,7 +55,7 @@ namespace WindBot.Game
catch (System.Exception) catch (System.Exception)
{ {
IPHostEntry _hostEntry = Dns.GetHostEntry(_serverHost); IPHostEntry _hostEntry = Dns.GetHostEntry(_serverHost);
target_address = _hostEntry.AddressList[0]; target_address = _hostEntry.AddressList.FirstOrDefault(findIPv4 => findIPv4.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
} }
Connection.Connect(target_address, _serverPort); Connection.Connect(target_address, _serverPort);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment