A class in Alta.Api.Client, Alta.Api.Client.HighLevel.
A server's session with Alta's web API: start, ping, online players and stop. Server side; returned by ServerApiClient for a positive server ID. Every call goes to the API, which no longer answers.
Constructors
1 private and internal constructor
Fields
4 private and internal fields
| Member | What it is |
|---|
private readonly IHighLevelApiClientManager apiClient | The client manager requests are sent through. |
private bool isRunningLocally | Whether the server started as a local server, which picks the stop call. |
private int? serverSession | Backing field for ServerSession. |
private GameServerInfo templateServer | Cached template server info. |
Properties
| Member | What it is |
|---|
bool IsActive { get; set; } | When false, start, ping, player updates and stop skip the API. Set false after stopping. |
GameServerInfo ServerInfo { get; } | The server's info from the API. |
int? ServerSession { get; } | The session ID the API gave on start, null before start or after stop. |
Methods
| Member | What it is |
|---|
async Task<GameServerInfo> GetTemplateServer() | For a world-owned server, fetches and caches the owner's template server info. Otherwise null. |
Task Ping() | Pings the session on the API while active. |
async Task SetOnlinePlayersAsync(IEnumerable<UserInfo> onlinePlayers) | Stores the online players and sends them to the API, once a session exists and while active. |
async Task StartAsync(ServerStartArguments startupArgs) | Starts a session on the API, as a local or hosted server depending on the start arguments. |
async Task StopAsync(ShutdownReason endReason) | Ends the session with a shutdown reason and marks the access inactive. |