Skip to main content

TavernLib.Patches

Every type in TavernLib.Patches, from TavernLib's own assembly. See the overview for how these pages are made.

TypeKindPublic membersWhat it is
CommandResultPatchesstatic class3Harmony patches on CommandService.HandleMatchedCommand and PlayerListConverter.ConvertFrom, so every console command's result reads properly: a player list that matched nobody is refused, and a thrown error shows its own message.
CommandSecurityPatchesclass5Harmony patches on the game's console and API checks: they turn off wrist-menu command routing and the TCP remote console, and skip the Alta permission and identity checks. Mostly matters on a server.
ConsoleEventsPatchclass3Harmony patches that raise the game's ConsoleEvents.PlayerJoined and PlayerLeft events when a player joins or leaves. Server.
ConsoleTokenPatchesstatic class7Harmony patches on the game's websocket console (ServerConsoleManager, WebSocketCommandHandler, CommandPart, CommandResult) that put TavernLib's console tokens in charge of logins, named token limits and the token log. Server only.
ConsoleTokenPatches.RefusedLoginFilterprivate class2A private NLog filter that drops the game's log lines that print the whole text of a refused console token. Added to every logging rule by ConsoleTokenPatches.Start.
CosmeticsPatchesclass2Postfixes ServerHostingGameMode.OnStartSucceeded to load every cosmetic into memory once the server has started. Server.
EventPatchesclass2The Harmony patch behind TavernEvents.SocketCreated: a postfix on the Alta.Networking.Socket constructor. Both sides.
ForestResetPatchesstatic class3Patches ForestGenerator.Wipe so a forest reset clears the forest and moves players out but keeps the running seed, saving the new seed for the next start. Server. Steps aside if another mod also prefixes Wipe.
ForestResetPatches.DeleteOldCachesstatic class2Postfixes ForestGenerator's explicit Load method to delete forest and river cache files named after any other seed, left over from a reset. Server.
ForestResetPatches.SaveQueuedSeedstatic class2Postfixes ForestGenerator's explicit Save method so the save holds a queued reset's new seed, and the next start builds that forest. Server.
GameCommandPatchesstatic class6Patches for game console commands that answered Success having done nothing: time set, time ofday, settings possible, select move/rotate exact, wacky destroy and world caves teleport. Applied by hand in OnLateInitializeMelon, not by attribute.
GarbageCollectIntervalPatchclass2Patches GarbageCollectTimer.Start to set the timer's interval from garbage_collection_timer in server_settings.json. Server.
JoinRejectionRecorderstatic class4Client patches on JoinServerPipeline and JoinResult that record a server's mod refusal in last_rejection.json and hand over to the launcher to install the mods and rejoin. Also owns the Quick join preference.
MessageExpanderPatchclass3Replaces the game's network message type header with an 8-bit one, for 256 message types, so TavernLib and mods have room for their own. It changes the wire format, so server and client both need it.
PlayerJoinFilterstatic class2Replaces the server's join request handler (prefix on ServerPlayerConnectionHandlerOld.InitializeConnection) with TavernLib's checks: Fly mode, account token, blacklist and whitelist, mod parity, then the game's CheckApproved. Server.
PlayerLimitPatchclass2Postfixes the ServerHandler.PlayerLimit getter so the limit comes from server_settings.json. Server.
SceneIndexPatchesclass2Forces the scene a client joins from /tutorialScene or /questScene, with a postfix on the JoinedServerGameMode constructor. Client.
SelectFixPatchstatic class1A MonoMod hook (applied in Tavern.OnLateInitializeMelon) that replaces SelectionCommandModule.FindObjects, the object search behind select find. Server.
SelectFixPatch.FindObjectsdelegate4The delegate for the original SelectionCommandModule.FindObjects, handed to SelectionFix by the hook.
ServerPortPatchesstatic class3Moves the game's hard-coded web server (1761) and websocket console (1760) to web_port and console_port in tavern_server.json, so two servers can share an address. Server.
ServerSettingsRolePatchclass3Sends each joining player their roles and limits who may change server settings from the settings board to owners and moderators. Server.
StatNamePatchclass2Prefixes StatManager.Awake to rename the stat definition with hash 44538 from damageprotection to crippledamageprotection, whose name clashes with another stat. Runs once.
TeenyPatchesclass13Small Harmony patches that let the game run without Alta's services: local cosmetic presets, free cosmetics only, local server joins, TavernLib's join token check and an always-online flag. Both sides.