PlayFabPartyUnity icon indicating copy to clipboard operation
PlayFabPartyUnity copied to clipboard

PlayFabMultiplayerManager.LeaveNetwork is broken

Open angebrajuka opened this issue 2 years ago • 7 comments

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.

angebrajuka avatar May 31 '23 15:05 angebrajuka

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.

nassosterz-ms avatar May 31 '23 19:05 nassosterz-ms

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.

angebrajuka avatar May 31 '23 19:05 angebrajuka

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.

nassosterz-ms avatar May 31 '23 19:05 nassosterz-ms

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.

angebrajuka avatar Jun 01 '23 13:06 angebrajuka

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 avatar Jun 01 '23 17:06 nassosterz-ms

Is there any update?

nassosterz-ms avatar Jun 05 '23 21:06 nassosterz-ms

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

angebrajuka avatar Jun 05 '23 21:06 angebrajuka