Methods
-
<async> getPlugins() → {Promise.<Array.<PluginData>>}
-
Description
Returns loaded plugins.
Returns
Details
-
<async> getPlugin( name ) → {Promise.<?PluginData>}
-
Description
Returns PluginData of the given plugin name.
Parameters
Name Type Description name
string Name of the plugin.
Returns
Details
-
<async> enablePlugin( name ) → {Promise.<boolean>}
-
Description
Enables a HHM plugin with the given name.
Parameters
Name Type Description name
string Name of the plugin
Returns
Details
-
<async> disablePlugin( name [, recursive ] ) → {Promise.<Array.<number>>}
-
Description
Disables a HHM plugin with the given name.
If the name is an Array then it disables all the plugins in the given order.
Parameters
Name Type Attributes Default Description name
string Name the plugin.
recursive
boolean <optional> false If true all the plugins that depend on the plugin will get disabled also.
Returns
Details
-
<async> getPluginsThatDependOn( name [, recursive [, includeDisabled ] ] ) → {Promise.<Array.<PluginData>>}
-
Description
Gets a list of plugins that depend on the given plugin.
Parameters
Name Type Attributes Default Description name
string Name or id of the plugin.
recursive
boolean <optional> true Finds indirect dependencies also.
includeDisabled
boolean <optional> false Include disabled plugins
Returns
Details
-
<async> hasPlugin( name ) → {Promise.<boolean>}
-
Description
Checks if the room has a plugin with given name loaded.
Parameters
Name Type Description name
string Name of the plugin.
Returns
Details
-
<async> addPlugin( plugin [, pluginConfig ] ) → {Promise.<number>}
-
Description
Adds a new plugin.
If the
plugin
isstring
, then it will be loaded from the available repositories.If the
plugin
is Plugin, then it will be loaded from contents ofPlugin
.Parameters
Name Type Attributes Description plugin
string | Plugin Plugins name if loading from repositories or plugin definition if loading it from an object.
pluginConfig
object <optional> Configuration options for the plugin.
Returns
Details
-
<async> removePlugin( pluginName [, safe ] ) → {Promise.<boolean>}
-
Description
Removes a plugin.
Parameters
Name Type Attributes Default Description pluginName
string Plugins name.
safe
boolean <optional> true Remove plugin safely (see HHM PluginManager#removePlugin).
Returns
Details
-
<async> setPluginConfig( pluginConfig [, pluginName ] )
-
Description
Sets the rooms plugin config. Merges the new config with the old one.
Tries to load plugins that are not loaded from the available repositories and removes the loaded plugins that are not in the given config.
If
pluginName
is given then only config for the given plugin is set.Parameters
Name Type Attributes Description pluginConfig
object Room wide config or plugins config.
pluginName
string <optional> Name of the plugin if wanting to change config of only one plugin.
Details
-
<async> getPluginConfig( [ pluginName ] ) → {Promise.<object>}
-
Description
Returns the plugin config for all loaded plugins in the room or if
pluginName
is given, then return the config for that plugin.Parameters
Name Type Attributes Description pluginName
string <optional> The name of the plugin.
Returns
Details
-
<async> reloadPlugin( pluginName [, safe ] ) → {boolean}
-
Description
Reloads a plugin from the configured repositories.
This is a wrapper around the HHM PluginManager.reloadPlugin method. See https://github.com/saviola777/haxball-headless-manager/blob/master/src/classes/PluginManager.js#L565
Parameters
Name Type Attributes Default Description pluginName
string Plugin name to be reloaded.
safe
boolean <optional> true Whether to disable dependent plugins before unloading the given plugin.
Returns
Throws
Details