#include <ISmmPlugin.h>
Public Member Functions | |
virtual int | GetApiVersion () |
Called to request the plugin's API version. | |
virtual | ~ISmmPlugin () |
Virtual destructor so GCC doesn't complain. | |
virtual bool | Load (PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late)=0 |
Called on plugin load. | |
virtual void | AllPluginsLoaded () |
Called when all plugins have been loaded. | |
virtual bool | QueryRunning (char *error, size_t maxlen) |
Called when your plugin is "queried". | |
virtual bool | Unload (char *error, size_t maxlen) |
Called on plugin unload. You can return false if you know your plugin is not capable of restoring critical states it modifies. | |
virtual bool | Pause (char *error, size_t maxlen) |
Called on plugin pause. | |
virtual bool | Unpause (char *error, size_t maxlen) |
Called on plugin unpause. | |
virtual const char * | GetAuthor ()=0 |
Return author as string. | |
virtual const char * | GetName ()=0 |
Return plugin name as string. | |
virtual const char * | GetDescription ()=0 |
Return a description as string. | |
virtual const char * | GetURL ()=0 |
Return a URL as string. | |
virtual const char * | GetLicense ()=0 |
Return quick license code as string. | |
virtual const char * | GetVersion ()=0 |
Return version as string. | |
virtual const char * | GetDate ()=0 |
Return author as string. | |
virtual const char * | GetLogTag ()=0 |
Return author as string. |
Definition at line 50 of file ISmmPlugin.h.
virtual int SourceMM::ISmmPlugin::GetApiVersion | ( | ) | [inline, virtual] |
This is the first callback invoked, and always remains at the top of the virtual table.
Definition at line 61 of file ISmmPlugin.h.
virtual bool SourceMM::ISmmPlugin::Load | ( | PluginId | id, | |
ISmmAPI * | ismm, | |||
char * | error, | |||
size_t | maxlength, | |||
bool | late | |||
) | [pure virtual] |
This is called as DLLInit() executes - after the parameters are known, but before the original GameDLL function is called. Therefore, you cannot hook it, but you don't need to - Load() is basically your hook. You can override factories before the engine and gamedll exchange them. However, take care to note that if your plugin is unloaded, and the gamedll/engine have cached an interface you've passed, something will definitely crash. Be careful.
id | Internal id of plugin. Saved globally by PLUGIN_SAVEVARS() | |
ismm | External API for SourceMM. Saved globally by PLUGIN_SAVEVARS() | |
error | Error message buffer | |
maxlength | Size of error message buffer | |
late | Set to true if your plugin was loaded late (not at server load). |
virtual void SourceMM::ISmmPlugin::AllPluginsLoaded | ( | ) | [inline, virtual] |
This is called after DLLInit(), and thus the mod has been mostly initialized. It is also safe to assume that all other (automatically loaded) plugins are now ready to start interacting, because they are all loaded.
Definition at line 101 of file ISmmPlugin.h.
virtual bool SourceMM::ISmmPlugin::QueryRunning | ( | char * | error, | |
size_t | maxlen | |||
) | [inline, virtual] |
This is useful for rejecting a loaded state. For example, if your plugin wants to stop operating, it can simply return false and copy an error message. This will notify other plugins or MM:S of something bad that happened. MM:S will not cache the return state, so if you return false, your plugin will not actually be paused or unloaded. This callback will be called when:
error | Buffer for error message, or NULL if none. | |
maxlen | Maximum length of error buffer. |
Definition at line 126 of file ISmmPlugin.h.
virtual bool SourceMM::ISmmPlugin::Unload | ( | char * | error, | |
size_t | maxlen | |||
) | [inline, virtual] |
error | Error message buffer | |
maxlen | Size of error message buffer |
Definition at line 139 of file ISmmPlugin.h.
virtual bool SourceMM::ISmmPlugin::Pause | ( | char * | error, | |
size_t | maxlen | |||
) | [inline, virtual] |
error | Error message buffer | |
maxlen | Size of error message buffer |
Definition at line 151 of file ISmmPlugin.h.
virtual bool SourceMM::ISmmPlugin::Unpause | ( | char * | error, | |
size_t | maxlen | |||
) | [inline, virtual] |
error | Error message buffer | |
maxlen | Size of error message buffer |
Definition at line 163 of file ISmmPlugin.h.