Added TShock.SendBytes which uses packetbuffer if available, otherwise sends like normal.

This commit is contained in:
high 2011-08-12 23:17:23 -04:00
parent 2ed91e26a0
commit 258b7d48fb
4 changed files with 44 additions and 19 deletions

View file

@ -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);
}
}