From b32e11a49f9fa6676f71517e5dd1ca0496d65170 Mon Sep 17 00:00:00 2001 From: Shank Date: Mon, 13 Jun 2011 15:20:17 -0600 Subject: [PATCH] Added DNS resolution for hostnames (no-ip and the like). --- TShockAPI/Tools.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Tools.cs b/TShockAPI/Tools.cs index ed0e7a78..6cafaf72 100755 --- a/TShockAPI/Tools.cs +++ b/TShockAPI/Tools.cs @@ -18,6 +18,7 @@ along with this program. If not, see . 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();