Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NetworkState in OnNetworkDestroyed instead of OnLeaveNetworkCompleted #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bschatt
Copy link

@bschatt bschatt commented Jun 13, 2024

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:

if (NetworkState != EPlayFabPartyNetworkState::NoNetwork || Network != nullptr)

if (NetworkState != EPlayFabPartyNetworkState::NoNetwork || Network != nullptr)

Updating the state in OnNetworkDestroyed instead handles both cases. As stated in the comment the PartyLeaveNetworkCompletedStateChange documentation clearly states that "an associated PartyNetworkDestroyedStateChange will be generated before this state change is generated." We have been able to confirm this behavior.

@bschatt bschatt changed the title Update NetworkState in OnNetworkDestroyed instead of OnLeaveNetworkCo… Update NetworkState in OnNetworkDestroyed instead of OnLeaveNetworkCompleted Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant