question

stevfofetta avatar image
stevfofetta asked

retrieve oldest member of a playfab group

I'm creating a game where players can form teams and when the administrator of a team leaves the team, the most senior member automatically becomes the administrator. How do I do this?

apis
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

·
Xiao Zha avatar image
Xiao Zha answered

Since PlayFab Group requires at least one administrator in the group at any time, if the group only has one administrator, you need to designate the next administrator before the current group administrator leaves. As a workaround, you can use the "group_members_added" event to trigger a cloud script, and in the script, use the Group Object to record the players who joined the group, then when the group admin wants to leave, you can first execute a cloud script to get the most senior member of the group in the Group Object and set it as an admin, then call the RemoveMembers Api to remove the admin player who is leaving and delete him/her from the group object.

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.