PluginManager - stingray.PluginManager namespace reference - Stingray Lua API Reference

stingray.PluginManager namespace reference

Description

Interface to interact with the Stingray plugin system.

The PluginManager is a singleton and can be used without creating an instance of the class.

Functions

Parameters

dir :

string

A directory to monitor for new DLLs.

Returns
This function does not return any values.

If a new plugin is found in the directory dir that matches the name of an already loaded plugin and that plugin supports the hot reload interface, the plugin will be reloaded.

Since the engine locks the DLLs it is using and the debugger can lock an arbitrary number of old .pdb files, you are recommended to add the following steps to your plugin's pre-build step:

rename ${plugin}.dll ${plugin}.dll.old
rename ${plugin}.pdb ${plugin}.${timestamp}.pdb.old
del *.old

Renaming ensures that the engine can still continue to use the old DLL while the new one is being created. We need to add a timestamp when renaming the PDB, since the debugger will lock any PDB it has encountered. The final del command must be set up to tolerate failure -- it will fail on the DLLs and PDBs that are still in use, leaving them in place.

Parameters
This function does not accept any parameters.
Returns

string[]

A list of the name of all loaded plugins.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

path :

string

The path to the plugin.

Returns

string?

If successful, returns the name of the loaded plugin, otherwise nil.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

If no such file exists or if it can't be loaded, the function will return nil.

Parameters

relative_path :

string

The relative path to the plugin from the application's plugin directory.

Returns

string?

If successful, returns the name of the loaded plugin, otherwise nil.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

If no such file exists or if it can't be loaded, the function will return nil.

Parameters

dir :

string

A directory that will no longer be monitored for new DLLs.

Returns
This function does not return any values.
Parameters

name :

string

The name of the plugin.

Returns
This function does not return any values.