Commit 5c5a87bb authored by nanahira's avatar nanahira

fix parsing ip

parent 0fd8b2d6
......@@ -45,8 +45,14 @@ namespace WindBot.Game
Connection.Connected += OnConnected;
Connection.PacketReceived += OnPacketReceived;
IPHostEntry _hostEntry = Dns.GetHostEntry(_serverHost);
Connection.Connect(_hostEntry.AddressList[0], _serverPort);
IPAddress target_address;
try {
IPHostEntry _hostEntry = Dns.GetHostEntry(_serverHost);
target_address = _hostEntry.AddressList[0];
} catch (System.Exception e) {
target_address = IPAddress.Parse(_serverHost);
}
Connection.Connect(target_address, _serverPort);
}
private void OnConnected()
......
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