PlayFab / PlayFabPartyUnity

38 stars 7 forks source link

PlayFabMultiplayerManger LeaveNetwork throws error #15

Closed AntonioFranchinotti closed 3 years ago

AntonioFranchinotti commented 3 years ago

We are creating a Unity sample using PlayFab Party to manage match lobbies.

When we want to leave a network (to leave a lobby), the SDK throws an error on the console (PARTY_STATE_CHANGE_RESULT_LEAVE_NETWORK_CALLED) and it never triggers the OnNetworkLeft listener.

This error can be reproduced in the Example that comes included with the PlayFabParty Unity SDK.

Stacktrace

PARTY_STATE_CHANGE_RESULT_LEAVE_NETWORK_CALLED
UnityEngine.Debug:LogError(Object)
PlayFab.Party.PlayFabMultiplayerManager:_LogError(String) (at Assets/PlayFabPartySDK/Source/Scripts/PartyUnitySDK/PlayFabMultiplayerManager.cs:450)
PlayFab.Party.PlayFabMultiplayerManager:InternalCheckStateChangeSucceededOrLogErrorIfFailedImpl(String, UInt32) (at Assets/PlayFabPartySDK/Source/Scripts/PartyUnitySDK/PlayFabMultiplayerManager.cs:1722)
PlayFab.Party.PlayFabMultiplayerManager:InternalCheckStateChangeSucceededOrLogErrorIfFailed(PARTY_STATE_CHANGE_RESULT, UInt32) (at Assets/PlayFabPartySDK/Source/Scripts/PartyUnitySDK/PlayFabMultiplayerManager.cs:1701)
PlayFab.Party.PlayFabMultiplayerManager:ProcessStateChanges() (at Assets/PlayFabPartySDK/Source/Scripts/PartyUnitySDK/PlayFabMultiplayerManager.cs:1843)
PlayFab.Party.PlayFabMultiplayerManager:Update() (at Assets/PlayFabPartySDK/Source/Scripts/PartyUnitySDK/PlayFabMultiplayerManager.cs:145)

To reproduce

  1. Connect to a Party Network.
  2. Trigger LeaveNetwork method (PlayFabMultiplayerManager.Get().LeaveNetwork()).
  3. Error 💣

Hint On the line 1843 of the PlayFabMultiplayerManager there's a validation that seems to be always failling (returning false) leaving the _isLeaveNetworkInProgress stuck as false.

AntonioFranchinotti commented 3 years ago

This was a bug that existed on v1.4.8.0-main.0 but was solved on v1.5.0.1-main.0 😬