I need to transfer temporary connection information along with the matchmaking request that will be available to the matched players once the match successfully completes, so that the players know how to reach each other.
I have attempted three different approaches for this. Please advice on what is wrong with my approaches, or if other approaches exist within PlayFab.
Solution 1: Player Attributes via GetMatchmakingTicket
The most elegant solution seems to be using the player attributes of `CreateMatchmakingTicket`, and then retrieving them with `GetMatchMakingTicket`.
However, I have hit some problems:
Specifically, I would like to retrieve the JSON object submitted as `CreateMatchmakingTicketRequest.Creator.Attributes`.
The documentation on `GetMatchmakingTicketResponse` (https://api.playfab.com/documentation/multiplayer/method/GetMatchmakingTicket) states:
Members (required) List<MatchmakingPlayer> > A list of Users that have joined this ticket.
This sounds like, once `Status == "matched"`, either
- `GetMatchmakingTicketResponse.Members` should contain the complete list of players matched using the ticket, including their `Attributes`, or
- `GetMatchmakingTicketResponse.Members` should contain the `Creator`, plus the players from `MembersToMatchWith` that have successfully called `JoinMatchmakingTicket`.
In practice, this seems to contain only the player from the `Creator` field of the calling player's own `CreateMatchmakingTicket` call (I am currently matchmaking only one user at a time, and so I do not know if JoinMatchmakingTicket callers are included).
Solution 2: Player Attributes via GetMatch
I can get the complete list of players by calling `GetMatch` (i.e. `GetMatchResult.Members`), but this list contains neither the `Attributes` not the ticket ids of the other tickets in the match. (The tickets would presumably contain their creator's attributes, providing a round-about solution to my problem.)
It seems `GetMatchResponse.Members` is supposed to contain the `Attributes` of each player; this is indicated by the comment on `GetMatchRequest.EscapeObject`:
```/** * Determines whether the matchmaking attributes will be returned as an escaped JSON string or as an un-escaped JSON * object. */ bool EscapeObject;```
I am not sure if this inconsistency is because EscapeObject should not be there, or if Attributes is indeed missing from GetMatchResponse.Members.
Solution 3: SetObjects / GetObjects on title_player_account
As a fallback, I have tried encoding the information I need transferred as Objects on the title_player_account entity of each player that enters matchmaking, by using SetObjects and GetObjects.
This fails, however, since GetObjects called with title_player_accounts of other players than the current player fail with "NotAuthorized".
I have tried to add the following to the global policy (via the web page) to allow this read to happen, but it does not seem to work.
{ "Action": "Read", "Effect": "Allow", "Resource": "pfrn:data--title_player_account!FA45/Profile/Objects/*", "Principal": "*", "Comment": "Allow everyone to read the default object." }
There is almost no information available on how to setup policies for pfrn:data resources, and what little there is deals almost exclusively with files.