#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 | engineFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 engine. | |
virtual CreateInterfaceFn | physicsFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 physics engine. | |
virtual CreateInterfaceFn | fileSystemFactory (bool syn=true)=0 |
Returns an interface factory for the HL2 file system. | |
virtual CreateInterfaceFn | serverFactory (bool syn=true)=0 |
Returns an interface factory for the GameDLL. | |
virtual CGlobalVars * | pGlobals ()=0 |
Returns a CGlobalVars pointer from the HL2 Engine. | |
virtual void | SetLastMetaReturn (META_RES res)=0 |
Used with SourceHook, sets teh last meta return value. Note: Do not call this directly, use the Metamod macros. | |
virtual META_RES | GetLastMetaReturn ()=0 |
Used with SourceHook, returns the last meta return value. Note: This is only valid inside a hook function. | |
virtual IConCommandBaseAccessor * | GetCvarBaseAccessor ()=0 |
Allows access to Metamod's ConCommandBaseAccessor. | |
virtual bool | RegisterConCmdBase (ISmmPlugin *plugin, ConCommandBase *pCommand)=0 |
Registers a ConCommandBase. | |
virtual void | UnregisterConCmdBase (ISmmPlugin *plugin, ConCommandBase *pCommand)=0 |
Unregisters a ConCommandBase. | |
virtual void | ConPrint (const char *str)=0 |
Prints an unformatted string to the remote server console. Note: Newlines are not added automatically. | |
virtual void | ConPrintf (const char *fmt,...)=0 |
Prints a formatted message to the remote server console. Note: Newlines are not added automatically. | |
virtual bool | RemotePrintingAvailable ()=0 |
Checks if ConPrint/ConPrintf will mirror to rcon. | |
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 for you. | |
virtual const char * | GetBaseDir ()=0 |
Returns the base directory of the game/server, equivalent to IVEngineServer::GetGameDir(), except the path is absolute. | |
virtual void | PathFormat (char *buffer, size_t len, const char *fmt,...)=0 |
Formats a file path to the local OS. Does not include any base directories. Note that all slashes and black slashes are reverted to the local OS's expectancy. | |
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. |
Definition at line 38 of file ISmmAPI.h.
virtual void ISmmAPI::LogMsg | ( | ISmmPlugin * | pl, | |
const char * | msg, | |||
... | ||||
) | [pure virtual] |
pl | Plugin API pointer (used for tagging message) | |
msg | Formatted string. |
virtual CreateInterfaceFn ISmmAPI::engineFactory | ( | 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 ISmmAPI::physicsFactory | ( | 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 ISmmAPI::fileSystemFactory | ( | 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 ISmmAPI::serverFactory | ( | 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 CGlobalVars* ISmmAPI::pGlobals | ( | ) | [pure virtual] |
virtual void ISmmAPI::SetLastMetaReturn | ( | META_RES | res | ) | [pure virtual] |
res | META_RETURN value to set. |
virtual META_RES ISmmAPI::GetLastMetaReturn | ( | ) | [pure virtual] |
virtual IConCommandBaseAccessor* ISmmAPI::GetCvarBaseAccessor | ( | ) | [pure virtual] |
virtual bool ISmmAPI::RegisterConCmdBase | ( | ISmmPlugin * | plugin, | |
ConCommandBase * | pCommand | |||
) | [pure virtual] |
plugin | Parent plugin API pointer. | |
pCommand | ConCommandBase to register. |
virtual void ISmmAPI::UnregisterConCmdBase | ( | ISmmPlugin * | plugin, | |
ConCommandBase * | pCommand | |||
) | [pure virtual] |
plugin | Parent plugin API pointer. | |
pCommand | ConCommandBase to unlink. |
virtual void ISmmAPI::ConPrint | ( | const char * | str | ) | [pure virtual] |
str | Message string. |
virtual void ISmmAPI::ConPrintf | ( | const char * | fmt, | |
... | ||||
) | [pure virtual] |
fmt | Formatted message. |
virtual bool ISmmAPI::RemotePrintingAvailable | ( | ) | [pure virtual] |
virtual void 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 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 ISmmAPI::AddListener | ( | ISmmPlugin * | plugin, | |
IMetamodListener * | pListener | |||
) | [pure virtual] |
plugin | Plugin interface pointer. | |
pListener | Listener interface pointer to add. |
virtual void* 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 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* 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* ISmmAPI::GetBaseDir | ( | ) | [pure virtual] |
virtual void ISmmAPI::PathFormat | ( | char * | buffer, | |
size_t | len, | |||
const char * | fmt, | |||
... | ||||
) | [pure virtual] |
buffer | Destination buffer to store path. | |
len | Maximum length of buffer, including null terminator. | |
fmt | Formatted string. |
virtual void ISmmAPI::ClientConPrintf | ( | edict_t * | client, | |
const char * | fmt, | |||
... | ||||
) | [pure virtual] |
client | Client edict pointer. | |
fmt | Formatted string to print to the client. |
virtual void* 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 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.
virtual int ISmmAPI::GetGameDLLVersion | ( | ) | [pure virtual] |
virtual int ISmmAPI::GetUserMessageCount | ( | ) | [pure virtual] |
virtual int 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* ISmmAPI::GetUserMessage | ( | int | index, | |
int * | size = NULL | |||
) | [pure virtual] |
index | User message index. | |
size | Optional pointer to store size of user message. |