Fixed issue of the client being killed before receiving the disconnect message.
This commit is contained in:
parent
4dae27001c
commit
7b58100546
3 changed files with 55 additions and 29 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue