Interface: PluginDefinition<Config, Ctx>
Every hook is optional: no init means ctx is undefined, no setup or negotiated means true.
Type Parameters
Config
Config = void
Ctx
Ctx = undefined
Properties
name
readonlyname:string
priority?
readonlyoptionalpriority?:number
Lower wins, like ElementDefinition.priority. Default 100. Ties go to the earlier entry in opts.plugins.
Methods
features()?
optionalfeatures(ctx):Feature[]
What the plugin offers, once per player after init.
Parameters
ctx
Ctx
Returns
Feature[]
init()?
optionalinit(config):Ctx
Once per player, in the constructor. The config comes from opts.plugins.
Parameters
config
Config
Returns
Ctx
negotiated()?
optionalnegotiated(ctx,serverSetup):boolean
After SERVER_SETUP. False means none of its features are used (its parameters were already sent).
Parameters
ctx
Ctx
serverSetup
Returns
boolean
setup()?
optionalsetup(ctx,clientSetup):boolean
Synchronous, in the constructor. Adds setup parameters to its own clientSetup; false drops the plugin.
Parameters
ctx
Ctx
clientSetup
Returns
boolean