question

Iain Brown avatar image
Iain Brown asked

How to join a friend's Party?

I'd like to implement an in-game friends list that shows all your friends that are currently in a joinable Playfab Party, and then allow you to join them. The only way I can see to do it is for Player A to write the network descriptor in to their user data, using PlayFabClientAPI::UpdateUserData, and then for Player B to call PlayFabClientAPI::GetFriendsList and then for each friend in their list to call PlayFabClientAPI::GetUserReadOnlyData to see who has a network descriptor in their user data.

Clearly this is an insane amount of api calls, and Player B can't tell which network descriptors are stale until they try to join the network.

Is there a better way of doing this?

Friends
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

·
Citrus Yan avatar image
Citrus Yan answered

According to your description, it seems that you want all the friends of a player expose their network descriptor of a joinable PlayFab Party, so that the player can use the descriptor to connect to that Party Network, is that right? If that’s the case, one important thing to note is that iterating players either from the client-side or the server-side (Cloud Script or your custom server) would certainly hit PlayFab service with far more calls that are allowed by the Terms of Service, hence it should be avoided.

You can use SetObjects to write the player’s network descriptor into his entity profile and use the GetProfiles API to get such information about a larger set of players ( the player’s friends ). And, regarding the stale descriptors problem, you can include the “Written date” associated with each descriptor to determine which are stale.

10 |1200

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

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.