A minimal source-compiled C# plugin for the Hosihikari framework. The C# loader compiles
main.cs at load with Roslyn and runs it in a collectible ALC; there is no build step for the
author.
-
Keep this repository outside the server. Rename the plugin: change
manifest.jsonname, renameMyCSharpPlugin.conf, and rename the class inmain.cs. The package directory name must equal the manifestname. -
Pack it with the framework packer. It restores
#:packageand copies the included source:pwsh ./pack.ps1bash ./pack.sh
The packer needs a sibling
PluginManagercheckout, orHOSIHIKARI_PLUGINMANAGERpointing at one. -
Copy
dist/MyCSharpPlugin/to<server>/plugins/MyCSharpPlugin/. -
Install the shim variant for the server and the C# loader:
lip install github.com/HosihikariFramework/HostingShim#levilamina # or #endstone lip install github.com/HosihikariFramework/CSharpLoader
-
Restart the server. The log shows the plugin loading and enabling.
For the self-hosted Linux carrier, install the suffix-less shim package and start the server through
hosihikari-server; loaders and plugins still live under plugins/.
manifest.json—loader: csharp, depends onhosihikariandhosihikari-csharp.main.cs— a public parameterless type implementingIPlugin. It also demonstrates two file-based directives:#:package System.IO.Hashing@10.0.13and#:include parts/helper.cs.parts/helper.cs— compiled withmain.csthrough#:include.pack.ps1/pack.sh— run the framework packer;dist/MyCSharpPlugin/is the installable package.MyCSharpPlugin.conf— package defaults.
The packer restores #:package at pack time and copies the included source; the server does not
download packages when it loads the plugin. #:include paths are relative to the including file
and may use globs such as ../shared/*.cs.
- Package defaults:
plugins/<name>/<name>.conf. - Server override:
config/hosihikari/<name>.conf. - Environment variables override the same keys.
- Runtime data:
data/hosihikari/<name>/.
OnLoad runs after dependencies are ready. OnEnable opens the event/timer gate; a refusal keeps
the plugin loaded and disabled. OnUnload releases what the plugin owns. An exception from a hook
is a fault and the host unloads the plugin.
See the authoring guide for the full contract.
MIT-0, see LICENSE.md.