ISmmAPI Class Reference

#include <ISmmAPI.h>

List of all members.

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.


Detailed Description

Definition at line 38 of file ISmmAPI.h.


Member Function Documentation

virtual void ISmmAPI::LogMsg ( ISmmPlugin pl,
const char *  msg,
  ... 
) [pure virtual]

Parameters:
pl Plugin API pointer (used for tagging message)
msg Formatted string.

virtual CreateInterfaceFn ISmmAPI::engineFactory ( bool  syn = true  )  [pure virtual]

Parameters:
syn If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned.
Returns:
CreateInterfaceFn function pointer.

virtual CreateInterfaceFn ISmmAPI::physicsFactory ( bool  syn = true  )  [pure virtual]

Parameters:
syn If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned.
Returns:
CreateInterfaceFn function pointer.

virtual CreateInterfaceFn ISmmAPI::fileSystemFactory ( bool  syn = true  )  [pure virtual]

Parameters:
syn If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned.
Returns:
CreateInterfaceFn function pointer.

virtual CreateInterfaceFn ISmmAPI::serverFactory ( bool  syn = true  )  [pure virtual]

Parameters:
syn If syn is true, the synthetic wrapper is returned. If syn is false, the true function is returned.
Returns:
CreateInterfaceFn function pointer.

virtual CGlobalVars* ISmmAPI::pGlobals (  )  [pure virtual]

Returns:
CGlobalVars pointer.

virtual void ISmmAPI::SetLastMetaReturn ( META_RES  res  )  [pure virtual]

Parameters:
res META_RETURN value to set.

virtual META_RES ISmmAPI::GetLastMetaReturn (  )  [pure virtual]

Returns:
Last META_RETURN value set by a plugin.

virtual IConCommandBaseAccessor* ISmmAPI::GetCvarBaseAccessor (  )  [pure virtual]

Returns:
Returns IConCommandBaseAccessor pointer.

virtual bool ISmmAPI::RegisterConCmdBase ( ISmmPlugin plugin,
ConCommandBase *  pCommand 
) [pure virtual]

Parameters:
plugin Parent plugin API pointer.
pCommand ConCommandBase to register.
Returns:
True if successful, false otherwise. Does not return false yet.

virtual void ISmmAPI::UnregisterConCmdBase ( ISmmPlugin plugin,
ConCommandBase *  pCommand 
) [pure virtual]

Parameters:
plugin Parent plugin API pointer.
pCommand ConCommandBase to unlink.

virtual void ISmmAPI::ConPrint ( const char *  str  )  [pure virtual]

Parameters:
str Message string.

virtual void ISmmAPI::ConPrintf ( const char *  fmt,
  ... 
) [pure virtual]

Parameters:
fmt Formatted message.

virtual bool ISmmAPI::RemotePrintingAvailable (  )  [pure virtual]

Returns:
True if remote printing available, false otherwise.

virtual void ISmmAPI::GetApiVersions ( int &  major,
int &  minor,
int &  plvers,
int &  plmin 
) [pure virtual]

Parameters:
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]

Parameters:
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]

Parameters:
plugin Plugin interface pointer.
pListener Listener interface pointer to add.

virtual void* ISmmAPI::MetaFactory ( const char *  iface,
int *  ret,
PluginId id 
) [pure virtual]

Parameters:
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
Returns:
Returned pointer

virtual int ISmmAPI::FormatIface ( char  iface[],
unsigned int  maxlength 
) [pure virtual]

Parameters:
iface Input/output interface name. Must be writable.
maxlength Maximum length of iface buffer. Must be at least strlen(iface)+4 chars.
Returns:
The newly incremented iface version number.

virtual void* ISmmAPI::InterfaceSearch ( CreateInterfaceFn  fn,
const char *  iface,
int  max,
int *  ret 
) [pure virtual]

Parameters:
fn InterfaceFactory function.
iface Interface string name.
max Maximum version to look up.
ret Last return code from interface factory function.
Returns:
Interface pointer, or NULL if not found.

virtual const char* ISmmAPI::GetBaseDir (  )  [pure virtual]

Returns:
Static pointer to game's absolute basedir.

virtual void ISmmAPI::PathFormat ( char *  buffer,
size_t  len,
const char *  fmt,
  ... 
) [pure virtual]

Parameters:
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]

Parameters:
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]

Parameters:
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.
Returns:
Interface pointer, or NULL if not found.

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]

Returns:
Interface version of the loaded IServerGameDLL.

virtual int ISmmAPI::GetUserMessageCount (  )  [pure virtual]

Returns:
Number of user messages, or -1 if SourceMM has failed to get user message list.

virtual int ISmmAPI::FindUserMessage ( const char *  name,
int *  size = NULL 
) [pure virtual]

Parameters:
name User message name.
size Optional pointer to store size of user message.
Returns:
Message index, or -1 on failure.

virtual const char* ISmmAPI::GetUserMessage ( int  index,
int *  size = NULL 
) [pure virtual]

Parameters:
index User message index.
size Optional pointer to store size of user message.
Returns:
Message name, or NULL on failure.


The documentation for this class was generated from the following file:

Generated on Mon Feb 18 18:27:28 2008 for Metamod:Source by  doxygen 1.5.5