Cleaned up stuff by chaning one tiny thing

This commit is contained in:
Maverick Motherfucker 2011-05-29 19:47:59 -07:00
parent 6d93d474ee
commit a7df7abda9
2 changed files with 32 additions and 15 deletions

View file

@ -472,6 +472,20 @@ namespace Terraria
return false;
}
public static bool IsAdmin(int ply)
{
string remoteEndPoint = Convert.ToString((Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
string[] remoteEndPointIP = remoteEndPoint.Split(':');
TextReader tr = new StreamReader(saveDir + "admins.txt");
string adminlist = tr.ReadToEnd();
tr.Close();
if (adminlist.Contains(remoteEndPointIP[0]))
{
return true;
}
return false;
}
public static string GetRealIP(string mess)
{
return mess.Split(':')[0];