Skip to main content

GroupMembersPage

A class in Root.Township, Alta.Meta.UI.ServerManagement.

Client menu page listing a group's members, with kick and ban options and an invite-by-username field. A GroupPage in the server management UI.

Constructors​

MemberWhat it is
GroupMembersPage()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private IAnalyticsService analyticsServiceAnalytics service used to report bans.
private TextRenderer emptyListTextText shown when the group has no members.
private GroupMemberListElement groupMemberListElementPrefab cloned for each member row.
private InputField inviteFieldInput field where the user types a username to invite.
private PanelComponent invitesPanelOutgoing invites panel, told to refresh after a new invite is sent.
private TextRenderer tooManyMembersTextText shown instead of the list when the group has more than 100 members.
private UIList uiListThe list that holds the member rows.

Methods​

MemberWhat it is
void Inject(IAnalyticsService analyticsService)VContainer injection point that supplies the analytics service.
override async void RefreshData()Hooks up the invite field and rebuilds the member list behind a loading screen.
protected override void OnGroupDataChange()Clears and destroys the member list when the shown group changes.
7 private and internal methods
MemberWhat it is
private void BanMember(GroupMember member)Asks for confirmation, then bans the member from the group's first server through SocialService and sends an analytics event.
private async void HandleInvitePressed(InputField obj)Handler for the invite field's Submitted event; runs InviteUser with the typed name behind a loading screen.
private async Task InviteUser(string username)Looks up a user by username through the API and adds a group invite for them, showing a popup with the result.
private void KickMember(GroupMember member)Asks for confirmation, then kicks the member with KickMemberAsync behind a loading screen.
private async Task KickMemberAsync(GroupMember member)Kicks the member through the API and shows an error popup if it fails.
private async Task SetupMembersList()Fetches all members and builds a list element for each. Shows a notice instead if the group has over 100 members.
private void ShowOptionsPopup(ListElementWithButton member)Shows Kick and Ban options for the selected member, depending on the local player's group permissions.

Used in​

Members of other types that take, return or hold a GroupMembersPage: