question

helloza123 avatar image
helloza123 asked

Is there any ways to get random players playfabIds in cloud scripts?

Hi, I want to create a friends system where a player will enter friend lobby scene and then the system will randomly select 5 players to show in the lobby and then the player can add them as friends or refresh the lobby to get new list of randomly selected players.

Is there any ways to get random player playfabIds in cloud scripts? I've searched through the forum but most of the answer just recommend to use Azure function but I don't want to use that for now as it would be too complicate for such a simple task.

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

It cannot be done legally on Cloud Script, there is no such server API that gets random player’s PlayFabId. However, you can do it in client side, with the Matchmaking feature as workaround. You can build your matchmaking queue and get 6 players in a match, then they can see the other 5 players’ title ids and custom attributes.

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

helloza123 avatar image helloza123 commented ·

Hi, Thanks for your advice. From what I understand, does it mean that the system will have a delay in order to get 6 players in a match? Is it mean that my game always have to have 6 concurrent users for this system to work?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ helloza123 commented ·

Yes, there can be delays, you can refer to this document for more detail Matchmaking quickstart - PlayFab | Microsoft Docs. And depending on how you configure your matchmaking queue, there should be at least 2 matchmaking tickets to create a match.

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.