Added DNS resolution for hostnames (no-ip and the like).

This commit is contained in:
Shank 2011-06-13 15:20:17 -06:00
parent 7608476005
commit b32e11a49f

View file

@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using Microsoft.Xna.Framework;
using Terraria;
@ -498,7 +499,9 @@ namespace TShockAPI
}
if (args[0].Equals(ip))
{
return GetGroup(args[1]);
IPHostEntry host = Dns.GetHostEntry(args[1]);
IPAddress[] ipaddr = host.AddressList;
return GetGroup(ipaddr.GetValue(0).ToString());
}
}
sr.Close();