Skip to main content

UserConfig.User

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

One registered player in users.json, made the first time they join through the auth port. On a client, EntranceMessageHandler.LocalUser uses it for the local player's roles.

Constructors​

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

Properties​

MemberWhat it is
bool CanEnterFlyMode { get; }True for moderators, owners and the fly role. Checked when a player joins in a Fly or camera mode.
bool IsModerator { get; }True for the moderator or owner role.
Dictionary<string, string> Mods { get; set; }The mods the player's game loads, id to version, from their last set_mods. Cleared at each auth-port join until sent again.
string RegisteredFrom { get; set; }The address the account was registered from. Whitelisted IPs also match accounts registered from them.
List<string> Roles { get; set; }The player's roles, such as owner, moderator, fly, dev, mod or supporter.
string Token { get; set; }The player's account token, which must match on every join to use this name.
ulong UserId { get; set; }The player's user id. New accounts get one past the highest in the file, starting at 1000000000.
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.

Methods​

MemberWhat it is
bool HasRole(string role)True if Roles has the role, ignoring case.

Used in​

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