Class endstone::PluginManager¶
ClassList > endstone > PluginManager
Represents a plugin manager that handles all plugins from the Server .
#include <endstone/plugin/plugin_manager.h>
Public Functions¶
Type | Name |
---|---|
PluginManager () = default |
|
PluginManager (PluginManager const &) = delete |
|
virtual Permission * | addPermission (std::unique_ptr< Permission > perm) = 0 |
virtual void | callEvent (Event & event) = 0 |
virtual void | clearPlugins () = 0 |
virtual void | disablePlugin (Plugin & plugin) = 0 |
virtual void | disablePlugins () = 0 |
virtual void | enablePlugin (Plugin & plugin) const = 0 |
virtual void | enablePlugins () const = 0 |
virtual std::unordered_set< Permissible * > | getDefaultPermSubscriptions (bool op) const = 0 |
virtual std::unordered_set< Permission * > | getDefaultPermissions (bool op) const = 0 |
virtual Permission * | getPermission (std::string name) const = 0 |
virtual std::unordered_set< Permissible * > | getPermissionSubscriptions (std::string permission) const = 0 |
virtual std::unordered_set< Permission * > | getPermissions () const = 0 |
virtual Plugin * | getPlugin (const std::string & name) const = 0 |
virtual std::vector< Plugin * > | getPlugins () const = 0 |
virtual bool | isPluginEnabled (const std::string & name) const = 0 |
virtual bool | isPluginEnabled (Plugin * plugin) const = 0 |
virtual Plugin * | loadPlugin (std::string file) = 0 |
virtual std::vector< Plugin * > | loadPlugins (std::string directory) = 0 |
virtual std::vector< Plugin * > | loadPlugins (std::vector< std::string > files) = 0 |
PluginManager & | operator= (PluginManager const &) = delete |
virtual void | recalculatePermissionDefaults (Permission & perm) = 0 |
virtual Result< void > | registerEvent (std::string event, std::function< void(Event &)> executor, EventPriority priority, Plugin & plugin, bool ignore_cancelled) = 0 |
virtual void | registerLoader (std::unique_ptr< PluginLoader > loader) = 0 |
virtual void | removePermission (Permission & perm) = 0 |
virtual void | removePermission (std::string name) = 0 |
virtual void | subscribeToDefaultPerms (bool op, Permissible & permissible) = 0 |
virtual void | subscribeToPermission (std::string permission, Permissible & permissible) = 0 |
virtual void | unsubscribeFromDefaultPerms (bool op, Permissible & permissible) = 0 |
virtual void | unsubscribeFromPermission (std::string permission, Permissible & permissible) = 0 |
virtual | ~PluginManager () = default |
Public Functions Documentation¶
function PluginManager [½]¶
function PluginManager [2/2]¶
function addPermission¶
virtual Permission * endstone::PluginManager::addPermission (
std::unique_ptr< Permission > perm
) = 0
Adds a Permission to this plugin manager.
Parameters:
perm
Permission to add
Returns:
Permission, or nullptr if a permission is already defined with the given name of the new permission
function callEvent¶
Calls an event which will be passed to plugins.
Parameters:
event
Event to be called
function clearPlugins¶
Disables and removes all plugins
function disablePlugin¶
Disables the specified plugin Attempting to disable a plugin that is not enabled will have no effect
Parameters:
plugin
Plugin to disable
function disablePlugins¶
Disables all the loaded plugins
function enablePlugin¶
Enables the specified plugin Attempting to enable a plugin that is already enabled will have no effect
Parameters:
plugin
Plugin to enable
function enablePlugins¶
Enable all the loaded plugins
function getDefaultPermSubscriptions¶
virtual std::unordered_set< Permissible * > endstone::PluginManager::getDefaultPermSubscriptions (
bool op
) const = 0
Gets a set containing all subscribed Permissibles to the given default list, by op status
Parameters:
op
Default list to query for
Returns:
Set containing all subscribed permissions
function getDefaultPermissions¶
virtual std::unordered_set< Permission * > endstone::PluginManager::getDefaultPermissions (
bool op
) const = 0
Gets the default permissions for the given op status
Parameters:
op
Which set of default permissions to get
Returns:
The default permissions
function getPermission¶
Gets a Permission from its fully qualified name
Parameters:
name
Name of the permission
Returns:
Permission, or null if none
function getPermissionSubscriptions¶
virtual std::unordered_set< Permissible * > endstone::PluginManager::getPermissionSubscriptions (
std::string permission
) const = 0
Gets a set containing all subscribed Permissibles to the given permission, by name
Parameters:
permission
Permission to query for
Returns:
Set containing all subscribed permissions
function getPermissions¶
Gets a set of all registered permissions.
This set is a copy and will not be modified live.
Returns:
Set containing all current registered permissions
function getPlugin¶
Checks if the given plugin is loaded and returns it when applicable. Please note that the name of the plugin is case-sensitive
Parameters:
name
Name of the plugin to check
Returns:
Plugin if it exists, otherwise nullptr
function getPlugins¶
Gets a list of all currently loaded plugins
Returns:
List of Plugins
function isPluginEnabled [½]¶
Checks if the given plugin is enabled or not Please note that the name of the plugin is case-sensitive.
Parameters:
name
Name of the plugin to check
Returns:
true if the plugin is enabled, otherwise false
function isPluginEnabled [2/2]¶
Checks if the given plugin is enabled or not
Parameters:
plugin
Plugin to check
Returns:
true if the plugin is enabled, otherwise false
function loadPlugin¶
Loads the plugin in the specified file
File must be valid according to the current enabled Plugin interfaces
Parameters:
file
File containing the plugin to load
Returns:
The Plugin loaded, or nullptr if it was invalid
function loadPlugins [½]¶
Loads the plugin contained within the specified directory
Parameters:
directory
Directory to check for plugins
Returns:
A list of all plugins loaded
function loadPlugins [2/2]¶
virtual std::vector< Plugin * > endstone::PluginManager::loadPlugins (
std::vector< std::string > files
) = 0
Loads the plugins in the list of the files
Parameters:
files
List of files containing plugins to load
Returns:
A list of all plugins loaded
function operator=¶
function recalculatePermissionDefaults¶
Recalculates the defaults for the given Permission.
This will have no effect if the specified permission is not registered here.
Parameters:
perm
Permission to recalculate
function registerEvent¶
virtual Result< void > endstone::PluginManager::registerEvent (
std::string event,
std::function< void( Event &)> executor,
EventPriority priority,
Plugin & plugin,
bool ignore_cancelled
) = 0
Registers the given event
Parameters:
event
Event name to registerexecutor
EventExecutor to registerpriority
Priority of this eventplugin
Plugin to registerignore_cancelled
Do not call executor if event was already cancelled
function registerLoader¶
Registers the specified plugin loader
Parameters:
loader
PluginLoader to register
function removePermission [½]¶
Removes a Permission registration from this plugin manager.
If the specified permission does not exist in this plugin manager, nothing will happen. Removing a permission registration will not remove the permission from any Permissibles that have it.
Parameters:
perm
Permission to remove
function removePermission [2/2]¶
Removes a Permission registration from this plugin manager.
If the specified permission does not exist in this plugin manager, nothing will happen. Removing a permission registration will not remove the permission from any Permissibles that have it.
Parameters:
name
Permission to remove
function subscribeToDefaultPerms¶
virtual void endstone::PluginManager::subscribeToDefaultPerms (
bool op,
Permissible & permissible
) = 0
Subscribes to the given Default permissions by operator status
If the specified defaults change in any form, the Permissible will be asked to recalculate.
Parameters:
op
Default list to subscribe topermissible
Permissible subscribing
function subscribeToPermission¶
virtual void endstone::PluginManager::subscribeToPermission (
std::string permission,
Permissible & permissible
) = 0
Subscribes the given Permissible for information about the requested Permission, by name. If the specified Permission changes in any form, the Permissible will be asked to recalculate.
Parameters:
permission
Permission to subscribe topermissible
Permissible subscribing
function unsubscribeFromDefaultPerms¶
virtual void endstone::PluginManager::unsubscribeFromDefaultPerms (
bool op,
Permissible & permissible
) = 0
Unsubscribes from the given Default permissions by operator status
Parameters:
op
Default list to unsubscribe frompermissible
Permissible subscribing
function unsubscribeFromPermission¶
virtual void endstone::PluginManager::unsubscribeFromPermission (
std::string permission,
Permissible & permissible
) = 0
Unsubscribes the given Permissible for information about the requested Permission, by name.
Parameters:
permission
Permission to unsubscribe frompermissible
Permissible subscribing
function ~PluginManager¶
The documentation for this class was generated from the following file include/endstone/plugin/plugin_manager.h