NFive

NFive

  • Docs
  • Help
  • API
  • Plugins
  • GitHub
  • Languages iconEnglish
    • Čeština
    • Español
    • Norsk
    • Português (Brasil)
    • Help Translate

›Server Side

Getting Started

  • Overview
  • Components
  • Database Setup
  • Server Setup
  • Installing Plugins
  • Administration
  • Troubleshooting

Plugin Manager

  • Overview
  • Command Reference

Plugin Development

  • Overview
  • Setup
  • Hub
  • Definition
  • Server Side

    • Life Cycle
    • Controller
    • Configurable Controller
    • Dependency Injection
    • Database Access
    • RCON

    Client Side

    • Life Cycle
    • Service
Edit

Controller

NFive.SDK.Server.Controllers.Controller

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 main assemblies.

Constructor

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.

Methods

  • Loaded()
  • Started()
  • Reload()

Loaded()

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.


Started()

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.


Reload()

public virtual Task Reload()

Triggered by user request, this method should run code to reset and reload any plugin configuration or cache.

Last updated on 5/16/2019
← Life CycleConfigurable Controller →
  • Constructor
  • Methods
    • Loaded()
    • Started()
    • Reload()
NFive
Docs
Getting StartedPlugin ManagerAPI Reference
Community
Getting HelpProject ChatDiscord NFive chat
More
Plugin HubGitHubNFive stargazers on GitHub