SourceMod SDK
1.7
|
Contains miscellaneous helper functions. More...
#include <public/ISourceMod.h>
Public Member Functions | |
virtual const char * | GetInterfaceName () |
Must return a string defining the interface's unique name. | |
virtual unsigned int | GetInterfaceVersion () |
Must return an integer defining the interface's version. | |
virtual const char * | GetGamePath () const =0 |
Returns the full path to the game directory. More... | |
virtual const char * | GetSourceModPath () const =0 |
Returns the full path to the SourceMod directory. More... | |
virtual size_t | BuildPath (PathType type, char *buffer, size_t maxlength, const char *format,...)=0 |
Builds a platform path for a specific target base path. More... | |
virtual void | LogMessage (IExtension *pExt, const char *format,...)=0 |
Logs a message to the SourceMod logs. More... | |
virtual void | LogError (IExtension *pExt, const char *format,...)=0 |
Logs a message to the SourceMod error logs. More... | |
virtual size_t | FormatString (char *buffer, size_t maxlength, SourcePawn::IPluginContext *pContext, const cell_t *params, unsigned int param)=0 |
Formats a string from a native. More... | |
virtual IDataPack * | CreateDataPack ()=0 |
Creates a data pack object. More... | |
virtual void | FreeDataPack (IDataPack *pack)=0 |
Releases a data pack's resources so it can be re-used. More... | |
virtual HandleType_t | GetDataPackHandleType (bool readonly=false)=0 |
Not implemented, do not use. More... | |
virtual KeyValues * | ReadKeyValuesHandle (Handle_t hndl, HandleError *err=NULL, bool root=false)=0 |
Retrieves a KeyValues pointer from a handle. More... | |
virtual const char * | GetGameFolderName () const =0 |
Returns the name of the game directory. More... | |
virtual SourcePawn::ISourcePawnEngine * | GetScriptingEngine ()=0 |
Returns the scripting engine interface. More... | |
virtual SourcePawn::IVirtualMachine * | GetScriptingVM ()=0 |
Deprecated, do not use. More... | |
virtual time_t | GetAdjustedTime ()=0 |
Returns the adjusted server time. More... | |
virtual unsigned int | SetGlobalTarget (unsigned int index)=0 |
Sets the global client SourceMod will use for assisted translations (that is, t). More... | |
virtual unsigned int | GetGlobalTarget () const =0 |
Returns the global client SourceMod is currently using for assisted translations (that is, t). More... | |
virtual void | AddGameFrameHook (GAME_FRAME_HOOK hook)=0 |
Adds a function to be called each game frame. More... | |
virtual void | RemoveGameFrameHook (GAME_FRAME_HOOK hook)=0 |
Removes one game frame hook matching the given function. More... | |
virtual size_t | Format (char *buffer, size_t maxlength, const char *fmt,...)=0 |
Platform-safe wrapper around snprintf(). More... | |
virtual size_t | FormatArgs (char *buffer, size_t maxlength, const char *fmt, va_list ap)=0 |
Platform-safe wrapper around vsnprintf(). More... | |
virtual void | AddFrameAction (FRAMEACTION fn, void *data)=0 |
Adds an action to be executed on the next available frame. More... | |
virtual const char * | GetCoreConfigValue (const char *key)=0 |
Retrieves a core.cfg configuration value. More... | |
virtual int | GetPluginId ()=0 |
Returns SourceMod's Metamod:Source plugin ID. More... | |
virtual int | GetShApiVersion ()=0 |
Returns SourceHook's API version. More... | |
virtual bool | IsMapRunning ()=0 |
Returns whether or not a map is currently running. More... | |
Public Member Functions inherited from SourceMod::SMInterface | |
virtual bool | IsVersionCompatible (unsigned int version) |
Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More... | |
Contains miscellaneous helper functions.
|
pure virtual |
Adds an action to be executed on the next available frame.
This function is thread safe.
fn | Function to execute. |
data | Data to pass to function. |
|
pure virtual |
Adds a function to be called each game frame.
hook | Hook function. |
|
pure virtual |
Builds a platform path for a specific target base path.
If the path starts with the string "file://" and the PathType is not relative, then the "file://" portion is stripped off, and the rest of the path is used without any modification (except for correcting slashes). This can be used to override the path builder to supply alternate absolute paths. Examples:
file://C:/Temp/file.txt file:///tmp/file.txt
type | Type of path to use as a base. |
buffer | Buffer to write to. |
maxlength | Size of buffer. |
format | Format string. |
... | Format arguments. |
|
pure virtual |
Creates a data pack object.
|
pure virtual |
Platform-safe wrapper around snprintf().
buffer | String buffer. |
maxlength | Maximum length of buffer. |
fmt | Format specifier string. |
... | Format arguments. |
|
pure virtual |
Platform-safe wrapper around vsnprintf().
buffer | String buffer. |
maxlength | Maximum length of buffer. |
fmt | Format specifier string. |
ap | Format arguments. |
|
pure virtual |
Formats a string from a native.
buffer | Buffer to store message. |
maxlength | Maximum length of buffer (including null terminator). |
pContext | Pointer to the plugin's context. |
params | Parameter array that was passed to the native. |
param | Parameter index where format string and variable arguments begin. Note: parameter indexes start at 1. |
|
pure virtual |
Releases a data pack's resources so it can be re-used.
pack | An IDataPack object to release. |
|
pure virtual |
Returns the adjusted server time.
|
pure virtual |
Retrieves a core.cfg configuration value.
key | Core.cfg key phrase. |
|
pure virtual |
Not implemented, do not use.
readonly | Ignored |
|
pure virtual |
Returns the name of the game directory.
|
pure virtual |
Returns the full path to the game directory.
|
pure virtual |
Returns the global client SourceMod is currently using for assisted translations (that is, t).
|
pure virtual |
Returns SourceMod's Metamod:Source plugin ID.
|
pure virtual |
Returns the scripting engine interface.
|
pure virtual |
Deprecated, do not use.
|
pure virtual |
Returns SourceHook's API version.
|
pure virtual |
Returns the full path to the SourceMod directory.
|
pure virtual |
Returns whether or not a map is currently running.
|
pure virtual |
Logs a message to the SourceMod error logs.
pExt | Extension calling this function. |
format | Message format. |
... | Message format parameters. |
|
pure virtual |
Logs a message to the SourceMod logs.
pExt | Extension calling this function. |
format | Message format. |
... | Message format parameters. |
|
pure virtual |
Retrieves a KeyValues pointer from a handle.
hndl | Handle_t from which to retrieve contents. |
err | Optional address to store a possible handle error. |
root | If true it will return the root KeyValues pointer for the whole structure. |
|
pure virtual |
Removes one game frame hook matching the given function.
hook | Hook function. |
|
pure virtual |
Sets the global client SourceMod will use for assisted translations (that is, t).
index | Client index. |