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
| Member | What it is |
|---|
CreateServerPanel() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private TextRenderer canCreateText | Text saying whether the player can create a server. |
private ServerDetailsPanel.ButtonData currentRegion | The chosen region button data; its data is the launch region sent to the API. |
private GameObject[] disableWhenCantCreate | Objects hidden when no more servers can be created, and after one is created. |
private ServerDetailsPanel.ButtonData[] regionButtonData | Region options, each tying a button to a region name. |
private ButtonCollection regionButtons | The region button group. |
Methods
| Member | What 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
| Member | What 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. |