Skip to main content

CreateServerPanel

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

Client main menu panel for creating a new server (group) through the Alta API, with name, description, join type and region.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private TextRenderer canCreateTextText saying whether the player can create a server.
private ServerDetailsPanel.ButtonData currentRegionThe chosen region button data; its data is the launch region sent to the API.
private GameObject[] disableWhenCantCreateObjects hidden when no more servers can be created, and after one is created.
private ServerDetailsPanel.ButtonData[] regionButtonDataRegion options, each tying a button to a region name.
private ButtonCollection regionButtonsThe region button group.

Methods​

MemberWhat it is
override async void RefreshData()Runs CheckIfCreateIsPossible behind a loading screen.
protected override string GetSummaryText()Builds the summary of name, description, join type and region shown before confirming.
protected override async Task Run()Creates the group and server through the API, then offers to manage it; shows a retry popup on failure.
protected override void Start()Listens for region button changes.
3 private and internal methods
MemberWhat it is
private async Task CheckIfCreateIsPossible()Asks the API if the player can create another server, sets the message and shows or hides the create controls.
private void HandleRegionChanged(ButtonCollection obj)Picks the region from the chosen button and updates the summary.
private async Task<bool> IsAllowedToCreateServer()True if the API's server allocation for the player has any left.