Fixed issue of the client being killed before receiving the disconnect message.

This commit is contained in:
high 2011-08-17 21:45:41 -04:00
parent 4dae27001c
commit 7b58100546
3 changed files with 55 additions and 29 deletions

View file

@ -156,6 +156,16 @@ namespace TShockAPI
public virtual void Disconnect(string reason)
{
SendData(PacketTypes.Disconnect, reason);
Flush();
}
public virtual void Flush()
{
var sock = Netplay.serverSock[Index];
if (sock == null)
return;
TShock.PacketBuffer.Flush(sock);
}