question

Jurica Adamek avatar image
Jurica Adamek asked

Getting DisplayName from Entity Id in a match

Hello,

I would like to get the DisplayNames of all players in a Match.

I am doing matchmaking via PlayFabMultiplayerAPI.GetMatch.
When I get the result, I can access all the members in the match. Every member has its Entity.
When I call PlayFabProfilesAPI.GetProfile with an entity, I get error "NotAuthorized". I am authenticated in the game with PlayFab account using PlayFabClientAPI.LoginWithPlayFab.

Am I doing something wrong or can I enable this in the Game Manager?

The code if it helps: https://monosnap.com/file/tHgOb0kFwkTcgBu3s0IFSkyaSIgWgb

entitiesMatchmaking
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

·
jital avatar image
jital answered

Hello,

Can you check inside your Game Manager, go to Settings->Client Profile Options, and verify the "Display Name" is checked under "Allow Client Access to Profile Properties".

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

Jurica Adamek avatar image Jurica Adamek commented ·

Yes, it is indeed checked.
I tried to run the code with all the access permissions checked, still getting "NotAuthorized" error.

0 Likes 0 ·
jital avatar image jital ♦ Jurica Adamek commented ·

I tried to reproduce your issue using the PlayFabProfilesAPI.GetProfile call, but I did not get the same error, I received null.

Is there a specific reason you need to use PlayFabProfilesAPI.GetProfile? Can you trying using PlayFabClientAPI.GetPlayerProfile instead?

I believe the issue lies somewhere in manually creating and editing the Entity Key. I will look more into this to see if I am correct.

0 Likes 0 ·
Jurica Adamek avatar image Jurica Adamek jital ♦ commented ·

To call PlayFabClientAPI.GetPlayerProfile I need PlayfabId. The GetMatch call returns GetMatchResult and in that structure, I get match members with EntityKeys and not PlayfabIds. Is there an API to convert EntityKey to PlayfabId if the entity is player?

As you said, its probably the manual creation of EntityKey, but Im not sure how else to get DisplayNames in a match.

0 Likes 0 ·
Show more comments

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.