question

jeremyhung999b avatar image
jeremyhung999b asked

How to retrieve Player's display name when a player joined my lobby,How to retrieve Player's display name when players joined my lobby

Upon players joined my lobby, I am able to get their PFEntitykey id and type, in order to get their display name, I then call GetAccountInfo or GetPlayerProfile mentioned in other post, however, requesting both APIs would require player's playfabId, so how am I able to get their playfabId, or is there a work around to get display names?

Here is an example of what I am trying to do. Players are now displaying their first 4 digits of PFEntitykey ID, but instead, I'd like to display their names

6450-lobby.png

,Upon players joined my lobby, I am able to get their PFEntitykey id and type, in order to get their display name, I then call GetAccountInfo or GetPlayerProfile mentioned in other post, however, requesting both APIs would require player's playfabId, so how am I able to get their playfabId, or is there a work around to get display names?

Here is an example of what I am trying to do. Players are now displaying their first 4 digits of PFEntitykey ID

6447-lobby.png

apismultiplayer
lobby.png (259.2 KiB)
lobby.png (259.2 KiB)
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

·
Infer Wang avatar image
Infer Wang answered

You may write a cloud script and call GetProfile to get playfabid. You can refer to this Request body .

 {
     "Entity": {
     "Id": "xxxx",
     "Type": "title_player_account",
     "TypeString": "title_player_account" 
     }
 }

Then, call GetPlayerProfile to get displayname.

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.