question

kashan chandia avatar image
kashan chandia asked

How to get the player display name with ListMembers role Id.

hello,

i am trying to add clan system in my game I want to list members and other roles in it.

i used ListMembers(); to get members but how do I get the displayname of Menber;

unity3d
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

·
Made Wang avatar image
Made Wang answered

Are you using the Group? If so, you can use ListGroupMembers to get the entities of all members, but currently PlayFab doesn’t support directly getting player DisplayName via this API.

There is a workaround, you need to call SetObjects beforehand to store the DisplayName of each player in the entity file. When needed, you can call GetObjects to get the DisplayName of each player based on their entity. You can refer to Use entity objects to store player data - PlayFab | Microsoft Docs to learn more.

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.

kashan chandia avatar image kashan chandia commented ·

thanks,

but I am using the ListGroupMembers. i just want to get playfabId of each player present in the group.

0 Likes 0 ·
Made Wang avatar image Made Wang kashan chandia commented ·

To clarify, ListGroupMembers can only get the entity of each player and cannot get the PlayFabId.

As mentioned in the previous reply, you can call SetObject to pre-store the DisplayName in the entity Object.

You can implement this method in Azure Function, and select the Event type as player_displayname_changed in the rule, and select the group and the method that needs to be executed.

In this way, when the player modifies the DisplayName, the player's DisplayName will be automatically added to the entity Object.

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.