Skip to content

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 std::vector< Plugin * > loadPlugins (const std::string & directory) = 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 [½]

endstone::PluginManager::PluginManager () = default

function PluginManager [2/2]

endstone::PluginManager::PluginManager (
    PluginManager const &
) = delete

function addPermission

virtual Permission * endstone::PluginManager::addPermission (
    std::unique_ptr< Permission > perm
) = 0

Adds a Permission to this plugin manager.

Parameters:

Returns:

Permission, or nullptr if a permission is already defined with the given name of the new permission


function callEvent

virtual void endstone::PluginManager::callEvent (
    Event & event
) = 0

Calls an event which will be passed to plugins.

Parameters:

  • event Event to be called

function clearPlugins

virtual void endstone::PluginManager::clearPlugins () = 0

Disables and removes all plugins


function disablePlugin

virtual void endstone::PluginManager::disablePlugin (
    Plugin & plugin
) = 0

Disables the specified plugin Attempting to disable a plugin that is not enabled will have no effect

Parameters:


function disablePlugins

virtual void endstone::PluginManager::disablePlugins () = 0

Disables all the loaded plugins


function enablePlugin

virtual void endstone::PluginManager::enablePlugin (
    Plugin & plugin
) const = 0

Enables the specified plugin Attempting to enable a plugin that is already enabled will have no effect

Parameters:


function enablePlugins

virtual void endstone::PluginManager::enablePlugins () const = 0

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

virtual Permission * endstone::PluginManager::getPermission (
    std::string name
) const = 0

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:

Returns:

Set containing all subscribed permissions


function getPermissions

virtual std::unordered_set< Permission * > endstone::PluginManager::getPermissions () const = 0

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

virtual Plugin * endstone::PluginManager::getPlugin (
    const std::string & name
) const = 0

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

virtual std::vector< Plugin * > endstone::PluginManager::getPlugins () const = 0

Gets a list of all currently loaded plugins

Returns:

List of Plugins


function isPluginEnabled [½]

virtual bool endstone::PluginManager::isPluginEnabled (
    const std::string & name
) const = 0

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]

virtual bool endstone::PluginManager::isPluginEnabled (
    Plugin * plugin
) const = 0

Checks if the given plugin is enabled or not

Parameters:

Returns:

true if the plugin is enabled, otherwise false


function loadPlugins

virtual std::vector< Plugin * > endstone::PluginManager::loadPlugins (
    const std::string & directory
) = 0

Loads the plugin contained within the specified directory

Parameters:

  • directory Directory to check for plugins

Returns:

A list of all plugins loaded


function operator=

PluginManager & endstone::PluginManager::operator= (
    PluginManager const &
) = delete

function recalculatePermissionDefaults

virtual void endstone::PluginManager::recalculatePermissionDefaults (
    Permission & perm
) = 0

Recalculates the defaults for the given Permission.

This will have no effect if the specified permission is not registered here.

Parameters:


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 register
  • executor EventExecutor to register
  • priority Priority of this event
  • plugin Plugin to register
  • ignore_cancelled Do not call executor if event was already cancelled

function registerLoader

virtual void endstone::PluginManager::registerLoader (
    std::unique_ptr< PluginLoader > loader
) = 0

Registers the specified plugin loader

Parameters:


function removePermission [½]

virtual void endstone::PluginManager::removePermission (
    Permission & perm
) = 0

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:


function removePermission [2/2]

virtual void endstone::PluginManager::removePermission (
    std::string name
) = 0

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:


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 to
  • permissible 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:


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 from
  • permissible 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:


function ~PluginManager

virtual endstone::PluginManager::~PluginManager () = default


The documentation for this class was generated from the following file include/endstone/plugin/plugin_manager.h