Skip to main content

ServerSettingsRolePatch

A class in TavernLib, TavernLib.Patches.

Sends each joining player their roles and limits who may change server settings from the settings board to owners and moderators. Server.

Constructors​

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

Methods​

MemberWhat it is
static void OnlyModeratorsChangeSettings(IPlayer player, ref Task<bool> __result)Postfix on ServerSettingsSync.IsServerSyncPermitted that allows only the owner and moderator roles, logging a warning for anyone else.
static void SendRolesToUser(Player __instance)Postfix on Player.InitializePlayerOnServer that sends the player their roles from users.json (none if they aren't in it).
1 private and internal method
MemberWhat it is
internal static void SendRoles(Connection connection, IReadOnlyList<string> roles)Internal: sends a connection the ReceiveRoles message with a list of role names. Also used when roles change.