Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ private void OnDestroy()
private void DisconnectRemoteClient(ulong clientId)
{
var transportId = ClientIdToTransportId(clientId);
MessagingSystem.ProcessSendQueues();
Copy link
Copy Markdown
Contributor Author

@jeffreyrainy jeffreyrainy Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any obvious timing issue with doing these two calls at those locations? I wonder if not doing them at a specific point in the frame could lead to knock-on effects.

NetworkConfig.NetworkTransport.DisconnectRemoteClient(transportId);
}

Expand Down Expand Up @@ -1821,6 +1822,10 @@ private void HandleRawTransportPoll(NetworkEvent networkEvent, ulong clientId, A
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)
Expand Down