Skip to main content

Other config files

The rest of TavernLib's ServerConfigFile classes. All server only. Read them if they help; leave writing to TavernLib.

Whitelist requests​

TavernLib.Backend.Server.Configs.WhitelistRequestList and WhitelistRequestsConfigFile. On TavernManager.WhitelistRequests.

whitelist_requests.json: players who asked to join a whitelisted server.

MemberJSON key
List<WhitelistRequest> Requestsrequests
WhitelistRequest.UsernameusernameAs they typed it.
WhitelistRequest.Ipip
WhitelistRequest.AppliedAtapplied_atA string, not a DateTime.

TavernLib adds to it, with Update, when a player asks to join. It skips a request with the same name and IP as one already there. With /launcherauth, the Server launcher handles requests and TavernLib ignores them. Approving a request is the host's job: they add the player to the whitelist in users.json.

Modlist​

TavernLib.Backend.Server.Configs.ModsList and ModsListConfig. Not on TavernManager.

The file named by /modlist on the command line: the mods a headless server keeps installed. See Mods on your server.

MemberWhat it is
List<string> Modsmods: entries like Author.Repo or Author.Repo@1.2.3.
static (string Id, string PinnedVersion) ParseEntry(string entry)Splits an entry at @. No @, or nothing after it, gives null for the version (latest).

The launcher's exported file also has repos and untracked keys. TavernLib ignores both on purpose: mods only come from trusted sources, and untracked entries are file names.

Mod sources​

TavernLib.Backend.Server.Configs.TrustedRepos and TrustedReposConfig. Not on TavernManager.

mod_repos.json: sources added with modmanager addrepo.

MemberWhat it is
int Schemaschema, 1.
Dictionary<string, string> Reposrepos: short name (user/repo) to base URL.
List<string> EffectiveRepoUrls()The default TavernMods source first, then every added one that isn't it.

Only modmanager addrepo adds a source, after checking it serves a real index. Naming a source in a modlist never does.

Console tokens​

TavernLib.Backend.RemoteConsole.ConsoleTokenList, ConsoleToken and ConsoleTokenFile.

console_tokens.json: the named console tokens and the owner token's generation. See Console and tokens.

ConsoleTokenListJSON key
int OwnerGenerationowner_generationGoes up on each token rotate owner.
List<ConsoleToken> Tokenstokens
ConsoleTokenJSON key
string Idid
string Namename
string Presetpresetfull, or a label like custom
List<string> AccessaccessCommand and module paths. See Console.
int GenerationgenerationGoes up on each rotate.
DateTime Created, DateTime? Expires, DateTime? Revoked, DateTime? LastUsed
bool IsFullPreset is full.
string Status(DateTime now)revoked, expired or active.
const string FullPreset = "full"

The token text isn't in the file. It's made from the row and the server's secret when needed.

Never write this file

The server checks tokens against its own copy in memory, read at start and refreshed only when the server itself changes the file (a token command, or a named token logging in). An edit from outside isn't seen until then. And if the file won't read when the server starts, every console token is refused, the owner's too, until it does. Use the token commands.

See also​