Skip to main content

IServerAccess

An interface in Alta.Api.Client, Alta.Api.Client.HighLevel.

Server-side handle for reporting one game server's session to the Alta API: start, stop, ping and online players. ServerAccess calls the API; LocalServerAccess does nothing.

Properties​

MemberWhat it is
bool IsActive { get; set; }Whether calls go to the API. StopAsync sets it false.
GameServerInfo ServerInfo { get; }The API's info for this game server.
int? ServerSession { get; }The session id the API returned from StartAsync, or null when no session is running.

Methods​

MemberWhat it is
Task<GameServerInfo> GetTemplateServer()Gets the template server info for a world-owned server (cached after the first call). Null otherwise.
Task Ping()Pings the current server session so the API knows the server is alive.
Task SetOnlinePlayersAsync(IEnumerable<UserInfo> onlinePlayers)Updates the server's online player list locally and, when active with a session, on the API.
Task StartAsync(ServerStartArguments startupArgs)Starts a server session on the API (or registers a local server) and stores the session id.
Task StopAsync(ShutdownReason reason)Ends the server session on the API with the given reason and marks the access inactive.

Used in​

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