Skip to main content

Tavern

A class in TavernLib, TavernLib.

TavernLib's MelonPlugin. It registers TavernLib's services, collects its console commands and applies its late patches. Both sides; MelonLoader creates it.

Constructors​

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

Fields​

MemberWhat it is
const string VersionTavernLib's version string, the same one given to MelonInfo.
2 private and internal fields
MemberWhat it is
private bool _didInitialLogArchiveSet after the timer's first tick, which archives the log once at startup.
private Timer _logArchiveTimerTimer that checks every 60 seconds whether unity-log.csv needs archiving; started on servers that TavernLib manages auth for.

Properties​

1 private and internal property
MemberWhat it is
internal static MelonLogger.Instance Logger { get; private set; }TavernLib's own MelonLogger.Instance, set in OnEarlyInitializeMelon. TavernLogger writes through it.

Methods​

MemberWhat it is
override void OnEarlyInitializeMelon()Sets up the services. Server: console tokens, mod reconcile, TavernManager, roles, backups. Client: mod folders and Quick join. Both: EntranceMessageHandler.
override void OnInitializeMelon()Collects TavernLib's console command modules into the game's CommandService.CommandCollection.
override void OnLateInitializeMelon()Hooks the select object search and applies GameCommandPatches, once Unity is up.
3 private and internal methods
MemberWhat it is
private void SetupSelectionFixPatch()Hooks SelectionCommandModule.FindObjects so select find runs SelectFixPatch.SelectionFix instead.
private void SetupServices()Registers TavernLib's services at early init: console tokens, mod reconcile, TavernManager, roles and backups on a server, and quick join on a client, plus EntranceMessageHandler on both.
private void StartLogArchiveTimer()Starts the timer that archives the log on its first tick (10 s after start) and then whenever it passes the size limit.