question

Preston Phillips avatar image
Preston Phillips asked

not triggering PARTY_STATE_CHANGE_TYPE_NETWORK_DESTROYED after PartyNetworkLeaveNetwork

Hi,
I am currently writing a custom network manager for unity using the 'PartyCSharpSDK' api but have ran into a problem with reconnecting to a network that I have previously left. (I am making a custom network manager rather then using the provided unity one as need multiple networks at the same time and have that working).


I have been told that I need to wait for the 'PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_NETWORK_DESTROYED' before I can try and reconnect else the network remains in the active networks. However I am never getting the state change after calling 'PartyCSharpSDK.SDK.PartyNetworkLeaveNetwork()'. I do get the 'PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_ENDPOINT_DESTROYED' and 'PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_INVITATION_DESTROYED' events. Other users in the network also get that the users endpoint has been destroyed.


If I try to call 'PartyCSharpSDK.SDK.PartyConnectToNetwork()' on the network without caring about the destroyed event it fails with the error 4102 (something like already connected). I can get the destroyed networks old handle using 'PartyCSharpSDK.SDK.PartyGetNetworks()' and try to reconnect as if I had gotten the handle from 'PartyConnectToNetwork()' but it fails with an error about the network already being flagged for destruction.


Anyone know what I could be doing wrong to not get the 'PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_NETWORK_DESTROYED' event or how I can fix not being able to reconnect to a network that I have already left?

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Rick Chen avatar image
Rick Chen answered

Could you please provide a code snippet of your custom network manager?

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Preston Phillips avatar image Preston Phillips commented ·

Sorry took so long to get this uploaded.
Here is the base class that takes care of party events and stuff.
I then have other classes call the PartyCSharpSDK.SDK as they need and register to the partymanager

0 Likes 0 ·
partymanager.txt (24.0 KiB)
Rick Chen avatar image Rick Chen ♦ Preston Phillips commented ·

Thanks for providing the information. I have been looking into your code but not found the issue yet. It could take some time for troubleshooting. I will let you know when I find something, your patience is appreciated.

1 Like 1 ·
Rick Chen avatar image Rick Chen ♦ Preston Phillips commented ·

I have checked the file you provided, but I cannot find where you have used the PartyCSharpSDK.SDK.PartyNetworkLeaveNetwork() or PartyCSharpSDK.SDK.PartyConnectToNetwork(). Could you please provide the code snippet where you have used those part?

0 Likes 0 ·
Preston Phillips avatar image Preston Phillips Rick Chen ♦ commented ·

network.txt

Here is the class that handles calling the PartyCSharpSDK.SDK calls

0 Likes 0 ·
network.txt (76.5 KiB)
Rick Chen avatar image Rick Chen ♦ Preston Phillips commented ·

I have checked the file you provided, it’s quite difficult to tell where the issue is. I notice that the way you handle PARTY_STATE_CHANGE_TYPE.PARTY_STATE_CHANGE_TYPE_ENDPOINT_DESTROYED is quite different than the one from PlayFabMultiplayerManager in Party SDK. And you have created a class OnlinePlayer instead of using the class PlayFabPlayer provided in Unity Party SDK. Apart from that I cannot find any other part that is suspicious. There are some dependencies in your code that I don’t have, it is hard to run your code on my machine.

The community is not a good place to ask for a demo of your customized SDK and the detailed reproducing steps, so I would suggest opening a support ticket and let the engineer investigate this issue further.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.