When the player lose the connection to PlayFab the Network is destroyed automatically. Since we didn't call LeaveNetwork in this case, OnLeaveNetworkCompleted will not be called. This means that the NetworkState will not be updated and it will be impossible to join or create another network as you can see in the snippet below:
Updating the state in OnNetworkDestroyed instead handles both cases. As stated in the comment the PartyLeaveNetworkCompletedStateChangedocumentation clearly states that "an associated PartyNetworkDestroyedStateChange will be generated before this state change is generated." We have been able to confirm this behavior.
When the player lose the connection to PlayFab the Network is destroyed automatically. Since we didn't call
LeaveNetwork
in this case,OnLeaveNetworkCompleted
will not be called. This means that theNetworkState
will not be updated and it will be impossible to join or create another network as you can see in the snippet below:https://github.com/PlayFab/PlayFabMultiplayerUnreal/blob/3a65b088ded963cfe4fb1cd43391a171e80470b3/Source/Private/OnlineSubsystemPlayFab.cpp#L688 https://github.com/PlayFab/PlayFabMultiplayerUnreal/blob/3a65b088ded963cfe4fb1cd43391a171e80470b3/Source/Private/OnlineSubsystemPlayFab.cpp#L764
Updating the state in
OnNetworkDestroyed
instead handles both cases. As stated in the comment thePartyLeaveNetworkCompletedStateChange
documentation clearly states that "an associatedPartyNetworkDestroyedStateChange
will be generated before this state change is generated." We have been able to confirm this behavior.