Skip to main content

ServerSettings

A class in TavernLib, TavernLib.Backend.Server.Configs.

The contents of server_settings.json. Unknown keys are kept. Read it through TavernManager.ServerConfig.

Constructors​

MemberWhat it is
ServerSettings()Created by TavernLib; mods don't make one.

Fields​

MemberWhat it is
const int DefaultMaxPlayers24, the player limit when max_players is 0 or less. The launcher's default too.

Properties​

MemberWhat it is
bool CommunityListed { get; private set; }community_listed: whether the server is sent to the Community Servers listing. Only read when TavernManager starts.
string CommunityListingToken { get; internal set; }community_listing_token, the server's secret for the listing. Made by ServerSettingsConfig.ReadFromFile when empty.
bool ConsoleOwnerLocalOnly { get; private set; }console_owner_local_only: when on, the owner console token only logs in from a loopback address.
bool EnforceIpLimit { get; private set; }enforce_ip_limit, on by default: at most 5 new names may register from one address.
float GarbageCollectionTimer { get; private set; }garbage_collection_timer, the game's garbage collect interval in seconds. Defaults to 30.
int MaxPlayers { get; private set; }max_players as written. Use PlayerLimit, which handles 0 or less.
string Name { get; private set; }name, shown on the listing and in ping replies. Defaults to My Tavern Server.
string Password { get; internal set; }password, a plain password typed in by hand. Reading the file swaps it for password_hash and removes it.
string PasswordHash { get; internal set; }password_hash: SHA-256 of SHA-256 of the password, or empty for none.
int PlayerLimit { get; }max_players, or DefaultMaxPlayers when that is 0 or less. Not saved to the file.
string PublicHostname { get; private set; }public_hostname, sent to the listing as the server's host name.
bool QuestScene { get; private set; }quest_scene: tells joining players the Quest scene is needed, and is the listing's fallback when no scene argument is given.
string Region { get; private set; }region, sent to the listing. Defaults to unknown.
int ServerBackupMaxBackups { get; private set; }server_backup_max_backups: how many backups to keep. 0 keeps all.
float ServerBackupTime { get; private set; }server_backup_time: hours between backups. 0 turns them off.
bool TutorialScene { get; private set; }tutorial_scene: like QuestScene, for the tutorial scene.
bool WhitelistEnabled { get; private set; }whitelist_enabled: turns the whitelist on. Without /launcherauth, a non-empty whitelist is on regardless.
1 private and internal property
MemberWhat it is
private IDictionary<string, JToken> Extra { get; set; }Holds JSON keys TavernLib doesn't model, so they are written back unchanged.

Used in​

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