This commit is contained in:
vis2k 2021-05-11 11:53:26 +08:00
parent 58b434ccff
commit 3c1ad95399

View File

@ -120,15 +120,7 @@ public override void Disconnect()
DisconnectInternal();
// THIS WAS PREVIOUSLY IN NETWORKCLIENT.DISCONNECT:
// call client OnDisconnected with connection to server
// => previously we used to send a DisconnectMessage to
// NetworkServer.localConnection. this would queue the
// message until NetworkClient.Update processes it.
// => invoking the client's OnDisconnected event directly
// here makes tests fail. so let's do it exactly the same
// order as before by queueing the event for next Update!
//OnDisconnectedEvent?.Invoke(connection);
// TODO move into DisconnectInternal? or not?
QueueDisconnectedEvent();
NetworkServer.RemoveLocalConnection();
}