fix: Migrate OnClientConnectedCallback invocation into StartHost [MTT-4972]#2277
Conversation
|
Is there a bug # this is associated with? HandleConnectionApproval just above in the same method invokes onclientconnected... either directly if scene management is disabled, or at the end of the Synchronize scene event if scene management is enabled. Isn't this change just going to fire it multiple times? |
Yeah, I forgot to mark it as draft. It was just a quick first pass example of what it would sort of look like. (still needs a ticket) |
…-4972] (Unity-Technologies#2277) * fix Migrate InvokeOnClientConnectedCallback into StartHost (for host only). * test Updating the NetworkManagerTests to validate this PR, it also validates that this update does not impact anything when scene management is disabled.
This assures that any NetworkBehaviour components attached to in-scene placed NetworkObjects will have their associated netcode/NetworkManager properties properly initialized when OnClientConnected is invoked.
MTT-4972
Changelog
NetworkManager.OnClientConnectedCallbackwas being invoked before in-scene placedNetworkObjects had been spawned when startingNetworkManageras a host.Testing and Documentation