fix: #3787 NetworkManager.StopClient() doesn't immediately call OnClientDisconnectInternal anymore

This commit is contained in:
mischa 2024-10-08 13:44:18 +02:00 committed by mischa
parent dec47b7b7d
commit 3313fa9c43
2 changed files with 4 additions and 5 deletions

View File

@ -632,11 +632,6 @@ public void StopClient()
// NetworkClient.OnTransportDisconnect
// NetworkManager.OnClientDisconnect
NetworkClient.Disconnect();
// UNET invoked OnDisconnected cleanup immediately.
// let's keep it for now, in case any projects depend on it.
// TODO simply remove this in the future.
OnClientDisconnectInternal();
}
// called when quitting the application by closing the window / pressing

View File

@ -51,8 +51,12 @@ public void StartClientTest()
[Test]
public void StopClientTest()
{
manager.StartServer();
UpdateTransport();
manager.StartClient();
UpdateTransport();
manager.StopClient();
UpdateTransport();
Assert.That(manager.mode == NetworkManagerMode.Offline);
}