32 #ifndef _INCLUDE_SOURCEMOD_MAIN_HELPER_INTERFACE_H_
33 #define _INCLUDE_SOURCEMOD_MAIN_HELPER_INTERFACE_H_
41 #include <sp_vm_api.h>
45 #define SMINTERFACE_SOURCEMOD_NAME "ISourceMod"
46 #define SMINTERFACE_SOURCEMOD_VERSION 13
71 typedef void (*GAME_FRAME_HOOK)(
bool simulating);
78 typedef void (*FRAMEACTION)(
void *data);
88 return SMINTERFACE_SOURCEMOD_NAME;
92 return SMINTERFACE_SOURCEMOD_VERSION;
128 virtual size_t BuildPath(PathType type,
char *buffer,
size_t maxlength,
const char *format, ...) =0;
161 SourcePawn::IPluginContext *pContext,
162 const cell_t *params,
163 unsigned int param) =0;
196 virtual KeyValues *
ReadKeyValuesHandle(Handle_t hndl, HandleError *err=NULL,
bool root=
false) =0;
268 virtual size_t Format(
char *buffer,
size_t maxlength,
const char *fmt, ...) = 0;
279 virtual size_t FormatArgs(
char *buffer,
size_t maxlength,
const char *fmt, va_list ap) = 0;
324 #endif //_INCLUDE_SOURCEMOD_MAIN_HELPER_INTERFACE_H_
virtual const char * GetSourceModPath() const =0
Returns the full path to the SourceMod directory.
virtual time_t GetAdjustedTime()=0
Returns the adjusted server time.
Defines the interface for creating, reading, and removing Handles.
virtual int GetPluginId()=0
Returns SourceMod's Metamod:Source plugin ID.
virtual HandleType_t GetDataPackHandleType(bool readonly=false)=0
Not implemented, do not use.
virtual unsigned int GetInterfaceVersion()
Must return an integer defining the interface's version.
Definition: ISourceMod.h:90
virtual IDataPack * CreateDataPack()=0
Creates a data pack object.
virtual void AddFrameAction(FRAMEACTION fn, void *data)=0
Adds an action to be executed on the next available frame.
virtual void LogMessage(IExtension *pExt, const char *format,...)=0
Logs a message to the SourceMod logs.
virtual void RemoveGameFrameHook(GAME_FRAME_HOOK hook)=0
Removes one game frame hook matching the given function.
virtual int GetShApiVersion()=0
Returns SourceHook's API version.
virtual void AddGameFrameHook(GAME_FRAME_HOOK hook)=0
Adds a function to be called each game frame.
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.
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
virtual void FreeDataPack(IDataPack *pack)=0
Releases a data pack's resources so it can be re-used.
Contains miscellaneous helper functions.
Definition: ISourceMod.h:83
virtual const char * GetGameFolderName() const =0
Returns the name of the game directory.
virtual KeyValues * ReadKeyValuesHandle(Handle_t hndl, HandleError *err=NULL, bool root=false)=0
Retrieves a KeyValues pointer from a handle.
virtual unsigned int GetGlobalTarget() const =0
Returns the global client SourceMod is currently using for assisted translations (that is...
Specifies a data pack that can only be written.
Definition: IDataPack.h:128
virtual unsigned int SetGlobalTarget(unsigned int index)=0
Sets the global client SourceMod will use for assisted translations (that is, t). ...
Definition: IAdminSystem.h:63
virtual size_t FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list ap)=0
Platform-safe wrapper around vsnprintf().
virtual SourcePawn::IVirtualMachine * GetScriptingVM()=0
Deprecated, do not use.
virtual SourcePawn::ISourcePawnEngine * GetScriptingEngine()=0
Returns the scripting engine interface.
virtual const char * GetGamePath() const =0
Returns the full path to the game directory.
Contains functions for packing data abstractly to/from plugins. The wrappers for creating these are c...
Encapsulates an IExtensionInterface and its dependencies.
Definition: IExtensionSys.h:53
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.
virtual const char * GetInterfaceName()
Must return a string defining the interface's unique name.
Definition: ISourceMod.h:86
virtual bool IsMapRunning()=0
Returns whether or not a map is currently running.
virtual const char * GetCoreConfigValue(const char *key)=0
Retrieves a core.cfg configuration value.
virtual size_t Format(char *buffer, size_t maxlength, const char *fmt,...)=0
Platform-safe wrapper around snprintf().
virtual void LogError(IExtension *pExt, const char *format,...)=0
Logs a message to the SourceMod error logs.