question

Jacob Grodman avatar image
Jacob Grodman asked

Get PlayFabId for makeshift matchmaking

Hello,

I'm working on a pretty simple chess-like board game, and could use some help managing my cloudscript functions. In my game, I have some basic friend request and acceptance functions. Then once people are friends, you can click on their name in your friends list and challenge them to a game. After making your first move, a Shared Group is created with both players as well as some board data.

My problem right now is pretty simple: my code really doesn't feel optimized. In my game, the friend list contains display names for a person's friends. Each time a player wants to challenge a friend to a game, the program has to do a client side GetAccountInfo to get their PlayFabId, then pass that id into the cloudscript that makes the game. GetUserAccountInfo seems restricted to the current user's data, since it doesn't allow the passing in of anything but a PlayFabId.

Am I even going about this the right way? I'm quite new to both game development and Playfab so maybe I'm not even doing this right.

Player DataShared Group Data
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

·
Seth Du avatar image
Seth Du answered

Usually, the client should cache a local copy of corresponding data from PlayFab and each “get” API calls will refresh that cached data.

In your scenario, players should cache a friend list data, which should contain everything the other functions will use later. I will suggest calling GetFriendsList API, and remember to configure ProfileConstraints in the request. You may store the list as a dictionary or an object so that when the player’s name in the list is clicked, the function can pass through any kind of data, not only DisplayName, to the target function is required.

Please feel free to tell us if you have any other questions.

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.