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?
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?
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.
69 People are following this question.