Skip to main content

ServerSettingsConfig

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

The ServerConfigFile for server_settings.json. Hashes plain passwords and makes a listing token when there is none.

Constructors​

MemberWhat it is
ServerSettingsConfig(string filePath)Created by TavernLib to read and write this config file at the given path.

Fields​

1 private and internal field
MemberWhat it is
private static readonly Regex Sha256HexRegex for a 64 character lowercase hex string, used to tell a stored hash from a plain password.

Methods​

MemberWhat it is
override void ReadFromFile()Reads the file, then makes and saves a random community_listing_token if it's empty.
protected override bool Tidy(ServerSettings settings)Swaps a plain password for its hash, or hashes a password_hash that isn't a SHA-256 hex string. Returns true when it changed anything.
1 private and internal method
MemberWhat it is
private static string Hash(string password)Hashes a password twice with SHA-256, the form stored in password_hash.

Used in​

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