GameServer.Hooks.PluginManager (GameServer v1.0.509)
Loads and manages hook plugins shipped as OTP applications under modules/plugins/*.
Each plugin is expected to be a directory named after the OTP app name (e.g. polyglot_hook)
containing:
modules/plugins/polyglot_hook/
ebin/polyglot_hook.app
ebin/Elixir.GameServer.Modules.PolyglotHook.beam
deps/*/ebin/*.beamThe plugin's .app env must include the key :hooks_module, whose value is either a
charlist or string module name like 'Elixir.GameServer.Modules.PolyglotHook'.
This manager is intentionally dependency-free: it only adds ebin directories to the code
path and uses Application.load/1 + Application.ensure_all_started/1.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec hook_modules() :: [{plugin_name(), module()}]
@spec list() :: [GameServer.Hooks.PluginManager.Plugin.t()]
@spec lookup(plugin_name()) :: {:ok, GameServer.Hooks.PluginManager.Plugin.t()} | {:error, term()}
@spec plugins_dir() :: String.t()
@spec reload() :: [GameServer.Hooks.PluginManager.Plugin.t()]
@spec reload_and_after_startup() :: %{ plugins: [GameServer.Hooks.PluginManager.Plugin.t()], after_startup: map() }
@spec start_link(keyword()) :: GenServer.on_start()