Class ServerSettings

Namespace
Unity.Multiplayer.Core

The server package's own settings, beside the session's NetConfig: the health endpoint, the admin console, where logs and saves go and how long a clean shutdown may take. Filled from server.json and the command line by ServerStartup.

public sealed class ServerSettings
Inheritance
ServerSettings
Inherited Members

Fields

DefaultHealthPort

The health endpoint's default TCP port.

public const ushort DefaultHealthPort = 8081

Field Value

ushort

DefaultKeepLogFiles

The default number of log files kept in LogsDirectory.

public const int DefaultKeepLogFiles = 10

Field Value

int

DefaultLogsDirectory

The default logs folder, relative to the package folder.

public const string DefaultLogsDirectory = "Logs"

Field Value

string

DefaultSavesDirectory

The default saves folder, relative to the package folder.

public const string DefaultSavesDirectory = "Saves"

Field Value

string

DefaultShutdownGraceSeconds

The default seconds a clean shutdown may take before the process quits anyway.

public const double DefaultShutdownGraceSeconds = 10

Field Value

double

HealthPath

The health endpoint's path.

public const string HealthPath = "/healthz"

Field Value

string

MaxShutdownGraceSeconds

The longest accepted ShutdownGraceSeconds.

public const double MaxShutdownGraceSeconds = 300

Field Value

double

Properties

AdminCommands

Read admin commands from standard input (AdminConsole). Off by default.

public bool AdminCommands { get; set; }

Property Value

bool

HealthPort

TCP port of the HTTP health endpoint (GET /healthz, see HealthEndpoint); 0 turns it off.

public ushort HealthPort { get; set; }

Property Value

ushort

KeepLogFiles

Log files kept in LogsDirectory; older ones are deleted at start. 0 keeps every file.

public int KeepLogFiles { get; set; }

Property Value

int

LogsDirectory

Where the server writes its log files; relative paths are under the package folder.

public string LogsDirectory { get; set; }

Property Value

string

SavesDirectory

Where the game keeps persistent data; relative paths are under the package folder.

public string SavesDirectory { get; set; }

Property Value

string

ShutdownGraceSeconds

Seconds a clean shutdown (SIGTERM, SIGINT, stop) may take before the process quits anyway.

public double ShutdownGraceSeconds { get; set; }

Property Value

double

Methods

Clone()

Returns a field-by-field copy.

public ServerSettings Clone()

Returns

ServerSettings

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Validate()

Lists every problem; an empty list means the settings are valid.

public IReadOnlyList<string> Validate()

Returns

IReadOnlyList<string>