Make sure players are connected before grabbing the IP

This commit is contained in:
Deathmax 2011-12-17 10:10:15 +08:00
parent cd0c8fab86
commit 886389e9d7

View file

@ -75,7 +75,7 @@ namespace TShockAPI
{
get
{
return RealPlayer ? TShock.Utils.GetRealIP(Netplay.serverSock[Index].tcpClient.Client.RemoteEndPoint.ToString()) : "";
return RealPlayer ? (Netplay.serverSock[Index].tcpClient.Connected ? TShock.Utils.GetRealIP(Netplay.serverSock[Index].tcpClient.Client.RemoteEndPoint.ToString()) : "") : "";
}
}
/// <summary>