Skip to main content

ModCommands

A static class in Root.Township, Alta.Console.Commands.

Console module mods: manages the game's built-in C# script mods (the .cs files DemoLoadScripts loads from the mods folder). Needs the server_owner permission.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerNLog logger for this module.

Methods​

MemberWhat it is
static void AddMod(string name, string content, bool isOverride)mods add: writes the given source text to name.cs in the mods folder and loads it; refuses an existing name unless overriding.
static string GetPath()mods path: returns the mods folder path.
static IEnumerable<ModInfo> ListMods()mods list: returns each loaded mod's name and whether it is active.
static void ReloadMods()mods refresh: rescans the mods folder for new mods.
static void RemoveMod(string name)mods remove: stops the matching mods, deletes their files and drops them from the loaded list.
static void RestartMod(string name)mods restart: stops the matching mods' instances and creates new ones.
static void StartMod(string name)mods start: creates new instances of the matching mods.
static void StopMod(string name)mods stop: stops the matching mods' instances.
1 private and internal method
MemberWhat it is
private static IEnumerable<ScriptBundleLoader.ScriptBundle> GetMods(string name)Looks up loaded mod bundles by name (case-insensitive), or all of them for *. Used by the other commands.