Skip to main content

ServerLifetimePipeline

A static class in Root.Township, Alta.Networking.Servers.

Server: starts the game server on a port and tracks the running server's info until its socket closes.

Fields​

MemberWhat it is
const string HostNameLog context key hostname.
const string ServerNameLog context key server_name.
const string ServerTransportTypeLog context key network_transport.
4 private and internal fields
MemberWhat it is
private static GameServerInfo currentServerInfo of the server being started or running.
private static Logger loggerLogger for this class.
private const string ServerIdentifierLog context key server_id, set to the server's name.
private const string ServerVersionLog context key server_version.

Methods​

MemberWhat it is
static async Task<bool> AttemptToStartServer(IServerAccess server, int port, bool isRunningLocally)Starts the server unless one is already starting or running; returns false in that case.
static string GetServerFleet()Fleet name of the running server, or null.
static string GetServerRegion()Launch region of the running server, or null.
3 private and internal methods
MemberWhat it is
private static void ServerEnded(ISocket socket)When the server socket closes, clears the server info and log context and sets IsServer false.
private static void StartRejected(string error)Logs a failed start and clears the server info.
private static async Task StartServerHandler(IServerAccess serverAccess, int port, bool isRunningLocally)Opens a KCP server socket, sets IsServer, and boots a ServerHandler that initializes the network scene.