question

umut avatar image
umut asked

PlayFabMultiplayerManager Unity Check If Party Exists With Given String

Hi,

I've created a system where i hold a guild inside groups and i want to integrate a chat system using the party feature. My problem stems from the fact that i cannot, for the life of me, figure out a way to make it so people can connect easily.

What i did was:

1. Check the group object to find a network id.

2a. If there is one, connect to it.

2b If there isn't one, create a new one, save the old one to the objects.

My problem:

If I:

1. Create a party.

2. Turn my game off.

3. Turn it back on.

4. Try to connect using the party from the last login.

I fail, as can be expected. Sadly the "fail" scenario on playfab party unity module seem to be not as polished as one would hope because not only do i get the same error event raised twice, the state of the object is never turned back from "ConnectingToNetwork". Making subsequent attempts to apply 2b of my previous list a pain.

I was hoping for one of two things:

1. A method to "CreateOrJoinNetwork" where the input is a network id and it tries to connect to it, but in case of a failure, just creates the network with the identical string.

2.JoinNetwork not failing like it is doing right now.

multiplayer
1 comment
10 |1200

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

Rick Chen avatar image Rick Chen ♦ commented ·

Thanks for your report. I have done a test on Unity:

  1. Start the game
  2. create a network using PlayFabMultiplayerManager.Get().CreateAndJoinNetwork();
  3. successfully created. copy the network id and stop the game.
  4. Start again, this time use JoinNetwork with the network id to join the network.
  5. getting the error "failed to establish or maintain a connection to a network or remote peer".

Is this error the same as you experienced? I will report this issue to the corresponding team and we will keep you informed if there are any update. Your patience is appreciated.

EDIT: this is normal situation, please check the answer.

0 Likes 0 ·

1 Answer

·
Rick Chen avatar image
Rick Chen answered

According to this document: PlayFab Party objects and their relationships. The networks that don't have any authenticated users are automatically destroyed after a timeout. What was the duration between turning game off and trying to reconnect? The network could be destroyed when you reconnect to the network, in this case, you could create a new network.

There is no way to implement the "CreateOrJoinNetwork" feature you mentioned, since it will allow players to define the network id. The network id should be generated by PlayFab service, not by players.

3 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.

WhereIsMyCarDude avatar image WhereIsMyCarDude commented ·

Hello,

I think I am in a similar situation. I have implemented a sort of invite system with shared group data. When a user starts the game he/she checks if they have any invites. In my test the game just tries to join the invite but because it is an old invite the networkid has expired. I get three error messages about it but PlayFabMultiplayerManager.State is still in ConnectingToNetwork.

My question is: Is there a way to get a FailedToConnect callback someware? And is there a way to reset the PlayFabMultiplayerManager to Initialized state after a failed connection (maybe should be automatic by the sdk?)?

0 Likes 0 ·
WhereIsMyCarDude avatar image WhereIsMyCarDude commented ·

Hello,

I think I am in a similar situation. I have implemented a sort of invite system with shared group data. When a user starts the game he/she checks if they have any invites. In my test the game just tries to join the invite but because it is an old invite the networkid has expired. I get three error messages about it but PlayFabMultiplayerManager.State is still in ConnectingToNetwork.

My question is: Is there a way to get a FailedToConnect callback someware? And is there a way to reset the PlayFabMultiplayerManager to Initialized state after a failed connection (maybe should be automatic by the sdk?)?

0 Likes 0 ·
WhereIsMyCarDude avatar image WhereIsMyCarDude WhereIsMyCarDude commented ·

Seems like I can destroy the PlayFabMultiplayerManager and recreate it to get to the correct state. Ok workaround at least

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.