Cleaned up stuff by chaning one tiny thing
This commit is contained in:
parent
6d93d474ee
commit
a7df7abda9
2 changed files with 32 additions and 15 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue