fix: flushing send and receive queues upon disconnection (#2274)
This commit is contained in:
Родитель
e4d0e7d214
Коммит
fc6e7571e8
|
@ -1341,6 +1341,7 @@ namespace Unity.Netcode
|
|||
private void DisconnectRemoteClient(ulong clientId)
|
||||
{
|
||||
var transportId = ClientIdToTransportId(clientId);
|
||||
MessagingSystem.ProcessSendQueues();
|
||||
NetworkConfig.NetworkTransport.DisconnectRemoteClient(transportId);
|
||||
}
|
||||
|
||||
|
@ -1821,6 +1822,10 @@ namespace Unity.Netcode
|
|||
NetworkLog.LogInfo($"Disconnect Event From {clientId}");
|
||||
}
|
||||
|
||||
// Process the incoming message queue so that we get everything from the server disconnecting us
|
||||
// or, if we are the server, so we got everything from that client.
|
||||
MessagingSystem.ProcessIncomingMessageQueue();
|
||||
|
||||
OnClientDisconnectCallback?.Invoke(clientId);
|
||||
|
||||
if (IsServer)
|
||||
|
|
Загрузка…
Ссылка в новой задаче