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 namestring Name of the plugin.
Returns
Details
-
<async> enablePlugin( name ) → {Promise.<boolean>}
-
Description
Enables a HHM plugin with the given name.
Parameters
Name Type Description namestring 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 namestring Name the plugin.
recursiveboolean <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 namestring Name or id of the plugin.
recursiveboolean <optional> true Finds indirect dependencies also.
includeDisabledboolean <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 namestring Name of the plugin.
Returns
Details
-
<async> addPlugin( plugin [, pluginConfig ] ) → {Promise.<number>}
-
Description
Adds a new plugin.
If the
pluginisstring, then it will be loaded from the available repositories.If the
pluginis Plugin, then it will be loaded from contents ofPlugin.Parameters
Name Type Attributes Description pluginstring | Plugin Plugins name if loading from repositories or plugin definition if loading it from an object.
pluginConfigobject <optional> Configuration options for the plugin.
Returns
Details
-
<async> removePlugin( pluginName [, safe ] ) → {Promise.<boolean>}
-
Description
Removes a plugin.
Parameters
Name Type Attributes Default Description pluginNamestring Plugins name.
safeboolean <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
pluginNameis given then only config for the given plugin is set.Parameters
Name Type Attributes Description pluginConfigobject Room wide config or plugins config.
pluginNamestring <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
pluginNameis given, then return the config for that plugin.Parameters
Name Type Attributes Description pluginNamestring <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 pluginNamestring Plugin name to be reloaded.
safeboolean <optional> true Whether to disable dependent plugins before unloading the given plugin.
Returns
Throws
Details