PlayFab / PlayFabPartyUnity

38 stars 7 forks source link

PlayFabMultiplayerManager.LeaveNetwork is broken #34

Open angebrajuka opened 1 year ago

angebrajuka commented 1 year ago

After leaving a network with other players still in the network, the OnNetworkLeft callback isn't called and the manager enters a broken state in which it can't host or join another network.

nassosterz-ms commented 1 year ago

Thank you for reporting this.

I just tried reproducing this and cannot observe this behavior. Could you give more information about the version of the PlayFab Party Unity plugin you are using? Also, what platform.

You can inspect this part of the code: PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_LEAVE_NETWORK_COMPLETED of PlayFabMultiplayerManager.cs.

I see with a debugger that I am hitting this state change and that OnNetworkLeft is called. Subsequently, I try to rejoin the network with success.

angebrajuka commented 1 year ago

I'm using PlayFab Party version 1.7.6.0-main.0 and I am on Windows 10. It only happens when there are multiple people in a network and a player leaves, that player not getting an OnNetworkLeft callback.

nassosterz-ms commented 1 year ago

Could you attach a debugger and see if you are hitting the state change I mentioned above? You can attach a debugger using either Visual Studio or Visual Studio Code.

angebrajuka commented 1 year ago

After a little more digging it seems like enabling "Run In Background" in the Player settings fixes the issue, perhaps it has something to do with my setup. I don't get the state change when Run In Background is off but I do get it when it's on. strange.

nassosterz-ms commented 1 year ago

Checked that our sample application had "Run In Background" enabled. Tried disabling it to see if this could be reproduced but no luck - specifically, in a network with multiple clients, the one that calls Leave Network is able to rejoin the network.

Also seeing with the debugger that PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_LEAVE_NETWORK_COMPLETED is called.

Trying to think if there is any way we could help here.

nassosterz-ms commented 1 year ago

Is there any update?

angebrajuka commented 1 year ago

I think this thread can be closed, it seems like a very specific set of circumstances to cause the error (potentially error on my part) and I was able to fix it in my case by enabling run in background