#include <ISmmAPI.h>
Public Member Functions | |
virtual void | LogMsg (ISmmPlugin *pl, const char *msg,...)=0 |
Logs a message through the HL2 log system. Note: Newlines are appended automatically. | |
virtual CreateInterfaceFn | GetEngineFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 engine. | |
virtual CreateInterfaceFn | GetPhysicsFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 physics engine. | |
virtual CreateInterfaceFn | GetFileSystemFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 file system. | |
virtual CreateInterfaceFn | GetServerFactory (bool syn=true)=0 |
Returns an interface factory for the GameDLL. | |
virtual CGlobalVars * | GetCGlobals ()=0 |
Returns a CGlobalVars pointer from the HL2 Engine. | |
virtual bool | RegisterConCommandBase (ISmmPlugin *plugin, ConCommandBase *pCommand)=0 |
Registers a ConCommandBase. | |
virtual void | UnregisterConCommandBase (ISmmPlugin *plugin, ConCommandBase *pCommand)=0 |
Unregisters a ConCommandBase. | |
virtual void | ConPrint (const char *str)=0 |
Prints an unformatted string to the remote server console. | |
virtual void | ConPrintf (const char *fmt,...)=0 |
Prints a formatted message to the remote server console. | |
virtual void | GetApiVersions (int &major, int &minor, int &plvers, int &plmin)=0 |
Returns the Metamod Version numbers as major version and minor (API) version. Changes to minor version are guaranteed to be backwards compatible. Changes to major version are not. | |
virtual void | GetShVersions (int &shvers, int &shimpl)=0 |
Returns sourcehook API version and implementation version. | |
virtual void | AddListener (ISmmPlugin *plugin, IMetamodListener *pListener)=0 |
Adds a Metamod listener. | |
virtual void * | MetaFactory (const char *iface, int *ret, PluginId *id)=0 |
Queries the metamod factory. | |
virtual int | FormatIface (char iface[], unsigned int maxlength)=0 |
Given a base interface name, such as ServerGameDLL or ServerGameDLL003, reformats the string to increase the number, then returns the new number. This is the base function to InterfaceSearch() and VInterfaceMatch(). | |
virtual void * | InterfaceSearch (CreateInterfaceFn fn, const char *iface, int max, int *ret)=0 |
Searches for an interface, eliminating the need to loop through FormatIface(). | |
virtual const char * | GetBaseDir ()=0 |
Returns the base directory of the game/server, equivalent to IVEngineServer::GetGameDir(), except the path is absolute. | |
virtual size_t | PathFormat (char *buffer, size_t len, const char *fmt,...)=0 |
Formats a file path to the local OS. | |
virtual void | ClientConPrintf (edict_t *client, const char *fmt,...)=0 |
Prints text in the specified client's console. Same as IVEngineServer::ClientPrintf except that it allows for string formatting. | |
virtual void * | VInterfaceMatch (CreateInterfaceFn fn, const char *iface, int min=-1)=0 |
Wrapper around InterfaceSearch(). Assumes no maximum. This is designed to replace the fact that searches only went upwards. The "V" is intended to convey that this is for Valve formatted interface strings. | |
virtual void | EnableVSPListener ()=0 |
Tells SourceMM to add VSP hooking capability to plugins. | |
virtual int | GetGameDLLVersion ()=0 |
Returns the interface version of the GameDLL's IServerGameDLL implementation. | |
virtual int | GetUserMessageCount ()=0 |
Returns the number of user messages in the GameDLL. | |
virtual int | FindUserMessage (const char *name, int *size=NULL)=0 |
Returns the index of the specified user message. | |
virtual const char * | GetUserMessage (int index, int *size=NULL)=0 |
Returns the name of the specified user message. | |
virtual int | GetVSPVersion ()=0 |
Returns the highest interface version of IServerPluginCallbacks that the engine supports. This is useful for games that run on older versions of the Source engine, such as The Ship. | |
virtual int | GetSourceEngineBuild ()=0 |
Returns the engine interface that MM:S is using as a backend. | |
virtual IServerPluginCallbacks * | GetVSPInfo (int *pVersion)=0 |
Returns the VSP listener loaded. | |
virtual size_t | Format (char *buffer, size_t maxlength, const char *format,...)=0 |
Formats a string. This is a platform safe wrapper around snprintf/_snprintf. | |
virtual size_t | FormatArgs (char *buffer, size_t maxlength, const char *format, va_list ap)=0 |
Formats a string. This is a platform safe wrapper around vsnprintf/_vsnprintf. |
Definition at line 63 of file ISmmAPI.h.
virtual void SourceMM::ISmmAPI::LogMsg | ( | ISmmPlugin * | pl, | |
const char * | msg, | |||
... | ||||
) | [pure virtual] |
pl | Plugin API pointer (used for tagging message) | |
msg | Formatted string. |
virtual CreateInterfaceFn SourceMM::ISmmAPI::GetEngineFactory | ( | bool | syn = true |
) | [pure virtual] |
syn | If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned. |
virtual CreateInterfaceFn SourceMM::ISmmAPI::GetPhysicsFactory | ( | bool | syn = true |
) | [pure virtual] |
syn | If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned. |
virtual CreateInterfaceFn SourceMM::ISmmAPI::GetFileSystemFactory | ( | bool | syn = true |
) | [pure virtual] |
syn | If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned. |
virtual CreateInterfaceFn SourceMM::ISmmAPI::GetServerFactory | ( | bool | syn = true |
) | [pure virtual] |
If syn is false, the true function is returned.
virtual CGlobalVars* SourceMM::ISmmAPI::GetCGlobals | ( | ) | [pure virtual] |
virtual bool SourceMM::ISmmAPI::RegisterConCommandBase | ( | ISmmPlugin * | plugin, | |
ConCommandBase * | pCommand | |||
) | [pure virtual] |
plugin | Parent plugin API pointer. | |
pCommand | ConCommandBase to register. |
virtual void SourceMM::ISmmAPI::UnregisterConCommandBase | ( | ISmmPlugin * | plugin, | |
ConCommandBase * | pCommand | |||
) | [pure virtual] |
plugin | Parent plugin API pointer. | |
pCommand | ConCommandBase to unlink. |
virtual void SourceMM::ISmmAPI::ConPrint | ( | const char * | str | ) | [pure virtual] |
Note: Newlines are not added automatically.
str | Message string. |
virtual void SourceMM::ISmmAPI::ConPrintf | ( | const char * | fmt, | |
... | ||||
) | [pure virtual] |
Note: Newlines are not added automatically.
fmt | Formatted message. |
virtual void SourceMM::ISmmAPI::GetApiVersions | ( | int & | major, | |
int & | minor, | |||
int & | plvers, | |||
int & | plmin | |||
) | [pure virtual] |
major | Filled with the major API version number. | |
minor | Filled with the minor API version number. | |
plvers | Filled with the current plugin API version number. | |
plmin | Filled with the minimum plugin API version number supported. |
virtual void SourceMM::ISmmAPI::GetShVersions | ( | int & | shvers, | |
int & | shimpl | |||
) | [pure virtual] |
shvers | Filled with the SourceHook API version number. | |
shimpl | Filled with the SourceHook implementation number. |
virtual void SourceMM::ISmmAPI::AddListener | ( | ISmmPlugin * | plugin, | |
IMetamodListener * | pListener | |||
) | [pure virtual] |
plugin | Plugin interface pointer. | |
pListener | Listener interface pointer to add. |
virtual void* SourceMM::ISmmAPI::MetaFactory | ( | const char * | iface, | |
int * | ret, | |||
PluginId * | id | |||
) | [pure virtual] |
iface | String containing interface name | |
ret | Optional pointer to store return status | |
id | Optional pointer to store id of plugin that overrode interface, 0 if none |
virtual int SourceMM::ISmmAPI::FormatIface | ( | char | iface[], | |
unsigned int | maxlength | |||
) | [pure virtual] |
iface | Input/output interface name. Must be writable. | |
maxlength | Maximum length of iface buffer. Must be at least strlen(iface)+4 chars. |
virtual void* SourceMM::ISmmAPI::InterfaceSearch | ( | CreateInterfaceFn | fn, | |
const char * | iface, | |||
int | max, | |||
int * | ret | |||
) | [pure virtual] |
fn | InterfaceFactory function. | |
iface | Interface string name. | |
max | Maximum version to look up. | |
ret | Last return code from interface factory function. |
virtual const char* SourceMM::ISmmAPI::GetBaseDir | ( | ) | [pure virtual] |
virtual size_t SourceMM::ISmmAPI::PathFormat | ( | char * | buffer, | |
size_t | len, | |||
const char * | fmt, | |||
... | ||||
) | [pure virtual] |
Does not include any base directories. Note that all slashes and black slashes are reverted to the local OS's expectancy.
buffer | Destination buffer to store path. | |
len | Maximum length of buffer, including null terminator. | |
fmt | Formatted string. | |
... | Arguments in the string. |
virtual void SourceMM::ISmmAPI::ClientConPrintf | ( | edict_t * | client, | |
const char * | fmt, | |||
... | ||||
) | [pure virtual] |
client | Client edict pointer. | |
fmt | Formatted string to print to the client. |
virtual void* SourceMM::ISmmAPI::VInterfaceMatch | ( | CreateInterfaceFn | fn, | |
const char * | iface, | |||
int | min = -1 | |||
) | [pure virtual] |
fn | Interface factory function. | |
iface | Interface string. | |
min | Minimum value to search from. If zero, searching begins from the first available version regardless of the interface. Note that this can return interfaces EARLIER than the version specified. A value of -1 (default) specifies the string version as the minimum. Any other value specifices the minimum value to search from. |
virtual void SourceMM::ISmmAPI::EnableVSPListener | ( | ) | [pure virtual] |
Since this potentially uses more resources than it would otherwise, plugins have to explicitly enable the feature. Whether requested or not, if it is enabled, all plugins will get a pointer to the VSP listener through IMetamodListener. This will not be called more than once for a given plugin; if it is requested more than once, each successive call will only give the pointer to plugins which have not yet received it.
virtual int SourceMM::ISmmAPI::GetGameDLLVersion | ( | ) | [pure virtual] |
virtual int SourceMM::ISmmAPI::GetUserMessageCount | ( | ) | [pure virtual] |
virtual int SourceMM::ISmmAPI::FindUserMessage | ( | const char * | name, | |
int * | size = NULL | |||
) | [pure virtual] |
name | User message name. | |
size | Optional pointer to store size of user message. |
virtual const char* SourceMM::ISmmAPI::GetUserMessage | ( | int | index, | |
int * | size = NULL | |||
) | [pure virtual] |
index | User message index. | |
size | Optional pointer to store size of user message. |
virtual int SourceMM::ISmmAPI::GetVSPVersion | ( | ) | [pure virtual] |
virtual int SourceMM::ISmmAPI::GetSourceEngineBuild | ( | ) | [pure virtual] |
The values will be one of the SOURCE_ENGINE_* constants from the top of this file.
virtual IServerPluginCallbacks* SourceMM::ISmmAPI::GetVSPInfo | ( | int * | pVersion | ) | [pure virtual] |
This is useful for late-loading plugins which need to decide whether to add a listener or not (or need to get the pointer at all).
pVersion | Optional pointer to store the VSP version. |
virtual size_t SourceMM::ISmmAPI::Format | ( | char * | buffer, | |
size_t | maxlength, | |||
const char * | format, | |||
... | ||||
) | [pure virtual] |
buffer | Buffer to write to. | |
maxlength | Maximum length of the buffer. | |
format | Format specifiers. | |
... | Format arguments. |
virtual size_t SourceMM::ISmmAPI::FormatArgs | ( | char * | buffer, | |
size_t | maxlength, | |||
const char * | format, | |||
va_list | ap | |||
) | [pure virtual] |
buffer | Buffer to write to. | |
maxlength | Maximum length of the buffer. | |
format | Format specifiers. | |
ap | Format argument list. |