A controller is the main entrypoint for server plugins. The NFive server starts the controllers on startup and they exist for the duration of the server uptime.
Plugins should contain one or more classes which inherit from
Controller in one of their
Controller(ILogger logger, IEventManager events, IRpcHandler rpc, IRconManager rcon)
A controller's constructor supports dependency injection via arguments, allowing for dynamic plugin interface sharing. For convenience the logger, events, RPC and RCON types are always provided and stored to local properties for easy access.
public virtual Task Loaded()
Run immediately after the plugin's constructor is called, provided for continence so that asynchronous code can be used during construction. NFive server will block and wait for this method to complete before loading the next plugin.
public virtual Task Started()
Run asynchronously at the same time for all plugins after they have all been loaded. This method is where all plugin startup logic should be ran.
public virtual Task Reload()
Triggered by user request, this method should run code to reset and reload any plugin configuration or cache.