Hook Manager

Hook Manager

The hook manager is a Lua object that is used to call out to Lua hooks.

Attributes

The hook manager should only be modified using its methods. Direct access to its attributes is not recommended.

Methods

The hook manager is created as a new instance for each network session, so its methods should be accessed using the colon operator, e.g.:

hook_manager:do_hook (...)

get_hook

This function retrieves the given hook, using the hooks library from the Lua include path.

If no hooks library is available or the specific hook function is not implemented, will return nil.

Otherwise, the hook function will be returned.

This function takes a single required positional parameter, the name of the hook function to retrieve.

do_hook

This function calls the given hook, using the hooks library from the Lua include path.

If no hooks library is available or the specific hook function is not implemented, control will return to the main flow.

Otherwise, the hook function will be called and the main flow will yield until the library function is complete.

This function takes a single required positional parameter, the name of the hook function to call. All subsequent parameters are passed directly to the hook.