1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix #14587: Send queued packets before disconnecting the client (#14596)

* Fix #14587: Send queued packets before disconnecting the client

* Log better information during network authentication
This commit is contained in:
ζeh Matt
2021-05-09 09:56:20 +03:00
committed by GitHub
parent 14845b61e5
commit 08ebc1ab41
4 changed files with 60 additions and 43 deletions

View File

@@ -155,6 +155,16 @@ void NetworkConnection::QueuePacket(NetworkPacket&& packet, bool front)
}
}
void NetworkConnection::Disconnect()
{
ShouldDisconnect = true;
}
bool NetworkConnection::IsValid() const
{
return !ShouldDisconnect && Socket->GetStatus() == SocketStatus::Connected;
}
void NetworkConnection::SendQueuedPackets()
{
while (!_outboundPackets.empty() && SendPacket(_outboundPackets.front()))