Cache the IP so that things don't shit bricks when Mono closes the socket.
This commit is contained in:
parent
045eddfcdc
commit
d1320e434c
2 changed files with 7 additions and 3 deletions
|
|
@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
|
||||
[assembly: AssemblyVersion("3.3.4.1217")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1217")]
|
||||
[assembly: AssemblyVersion("3.3.4.1218")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1218")]
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ namespace TShockAPI
|
|||
public bool ForceSpawn = false;
|
||||
public string Country = "??";
|
||||
public int Difficulty;
|
||||
private string CacheIP;
|
||||
|
||||
public bool RealPlayer
|
||||
{
|
||||
|
|
@ -75,7 +76,10 @@ namespace TShockAPI
|
|||
{
|
||||
get
|
||||
{
|
||||
return RealPlayer ? (Netplay.serverSock[Index].tcpClient.Connected ? TShock.Utils.GetRealIP(Netplay.serverSock[Index].tcpClient.Client.RemoteEndPoint.ToString()) : "") : "";
|
||||
if (string.IsNullOrEmpty(CacheIP))
|
||||
return CacheIP = RealPlayer ? (Netplay.serverSock[Index].tcpClient.Connected ? TShock.Utils.GetRealIP(Netplay.serverSock[Index].tcpClient.Client.RemoteEndPoint.ToString()) : "") : "";
|
||||
else
|
||||
return CacheIP;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue