Added TShock.SendBytes which uses packetbuffer if available, otherwise sends like normal.
This commit is contained in:
parent
2ed91e26a0
commit
258b7d48fb
4 changed files with 44 additions and 19 deletions
|
|
@ -339,20 +339,7 @@ namespace TShockAPI
|
|||
if (!RealPlayer || !ConnectionAlive)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
if (Netplay.serverSock[Index].tcpClient.Connected)
|
||||
{
|
||||
Netplay.serverSock[Index].networkStream.Write(data, 0, data.Length);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.ToString());
|
||||
}
|
||||
return false;
|
||||
return TShock.SendBytes(Netplay.serverSock[Index], data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue