SourceMod SDK  1.7
SourceMod::IGameHelpers Class Referenceabstract
Inheritance diagram for SourceMod::IGameHelpers:
SourceMod::SMInterface

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 SendProp * FindInSendTable (const char *classname, const char *offset)=0
 Deprecated; use FindSendPropInfo() instead. More...
 
virtual ServerClass * FindServerClass (const char *classname)=0
 Finds a named server class. More...
 
virtual typedescription_t * FindInDataMap (datamap_t *pMap, const char *offset)=0
 Finds a datamap_t definition. More...
 
virtual datamap_t * GetDataMap (CBaseEntity *pEntity)=0
 Retrieves an entity's datamap_t pointer. More...
 
virtual void SetEdictStateChanged (edict_t *pEdict, unsigned short offset)=0
 Marks an edict as state changed for an offset. More...
 
virtual bool TextMsg (int client, int dest, const char *msg)=0
 Sends a text message to a client. More...
 
virtual bool IsLANServer ()=0
 Returns whether the server ls a LAN server. More...
 
virtual bool FindSendPropInfo (const char *classname, const char *offset, sm_sendprop_info_t *info)=0
 Finds a send property in a named ServerClass. More...
 
virtual edict_t * EdictOfIndex (int index)=0
 Converts an entity index into an edict pointer. More...
 
virtual int IndexOfEdict (edict_t *pEnt)=0
 Converts an edict pointer into an entity index. More...
 
virtual edict_t * GetHandleEntity (CBaseHandle &hndl)=0
 Retrieves the edict pointer from a CBaseHandle object. More...
 
virtual void SetHandleEntity (CBaseHandle &hndl, edict_t *pEnt)=0
 Sets the edict pointer in a CBaseHandle object. More...
 
virtual const char * GetCurrentMap ()=0
 Returns the current map name. More...
 
virtual void ServerCommand (const char *buffer)=0
 Wraps IVEngineServer::ServerCommand. More...
 
virtual CBaseEntity * ReferenceToEntity (cell_t entRef)=0
 Looks up a reference and returns the CBasseEntity* it points to. More...
 
virtual cell_t EntityToReference (CBaseEntity *pEntity)=0
 Returns the entity reference for an entity. More...
 
virtual cell_t EntityToBCompatRef (CBaseEntity *pEntity)=0
 Returns the entity reference for logical entities, or the index for networked entities. More...
 
virtual cell_t IndexToReference (int entIndex)=0
 Converts an entity index into an entity reference. More...
 
virtual int ReferenceToIndex (cell_t entRef)=0
 Retrieves the entity index from a reference. More...
 
virtual cell_t ReferenceToBCompatRef (cell_t entRef)=0
 Converts a reference into a bcompat version (index for networked entities). More...
 
virtual void * GetGlobalEntityList ()=0
 Returns the g_EntList pointer. More...
 
virtual void AddDelayedKick (int client, int userid, const char *msg)=0
 Adds a client to the kick queue, where they will be kicked next game frame. More...
 
virtual int GetSendPropOffset (SendProp *prop)=0
 Returns the uncomputed offset of a SendProp. More...
 
virtual bool HintTextMsg (int client, const char *msg)=0
 Sends a hint message to a client. More...
 
virtual ICommandLine * GetValveCommandLine ()=0
 Retrieves the Valve command line pointer. More...
 
virtual const char * GetEntityClassname (edict_t *pEdict)=0
 Gets a Classname from an edict_t pointer. More...
 
virtual const char * GetEntityClassname (CBaseEntity *pEntity)=0
 Gets a Classname from an CBaseEntity pointer. More...
 
virtual bool IsMapValid (const char *map)=0
 Returns whether or not a map name is valid to use with the engine's Changelevel functionality. It need not be an exact filename on some engines. For a check on the exact name, use IVEngineServer::IsMapValid. More...
 
virtual bool FindDataMapInfo (datamap_t *pMap, const char *offset, sm_datatable_info_t *pDataTable)=0
 Finds a datamap_t definition. 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...
 

Member Function Documentation

virtual void SourceMod::IGameHelpers::AddDelayedKick ( int  client,
int  userid,
const char *  msg 
)
pure virtual

Adds a client to the kick queue, where they will be kicked next game frame.

The user ID is used to ensure the correct player is kicked.

Parameters
clientThe index of the client to kick.
useridThe user ID of the client to kick.
msgThe kick message to show to the player.
virtual edict_t* SourceMod::IGameHelpers::EdictOfIndex ( int  index)
pure virtual

Converts an entity index into an edict pointer.

Parameters
indexEntity Index.
Returns
Edict pointer or NULL on failure.
virtual cell_t SourceMod::IGameHelpers::EntityToBCompatRef ( CBaseEntity *  pEntity)
pure virtual

Returns the entity reference for logical entities, or the index for networked entities.

Parameters
pEntityEntity pointer.
Returns
Entity reference/index.
virtual cell_t SourceMod::IGameHelpers::EntityToReference ( CBaseEntity *  pEntity)
pure virtual

Returns the entity reference for an entity.

Parameters
pEntityEntity pointer.
Returns
Entity reference.
virtual bool SourceMod::IGameHelpers::FindDataMapInfo ( datamap_t *  pMap,
const char *  offset,
sm_datatable_info_t pDataTable 
)
pure virtual

Finds a datamap_t definition.

Parameters
pMapdatamap_t pointer.
offsetProperty name.
pDataTableBuffer to store sm_datatable_info_t data.
Returns
typedescription_t pointer on success, NULL on failure.
virtual typedescription_t* SourceMod::IGameHelpers::FindInDataMap ( datamap_t *  pMap,
const char *  offset 
)
pure virtual

Finds a datamap_t definition.

Parameters
pMapdatamap_t pointer.
offsetProperty name.
Returns
typedescription_t pointer on success, NULL on failure.
virtual SendProp* SourceMod::IGameHelpers::FindInSendTable ( const char *  classname,
const char *  offset 
)
pure virtual

Deprecated; use FindSendPropInfo() instead.

Parameters
classnameDo not use.
offsetDo not use.
Returns
Do not use.
virtual bool SourceMod::IGameHelpers::FindSendPropInfo ( const char *  classname,
const char *  offset,
sm_sendprop_info_t info 
)
pure virtual

Finds a send property in a named ServerClass.

This version, unlike FindInSendTable(), correctly deduces the offsets of nested tables.

Parameters
classnameServerClass name (such as CBasePlayer).
offsetOffset name (such as m_iAmmo).
infoBuffer to store sm_sendprop_info_t data.
Returns
True on success, false on failure.
virtual ServerClass* SourceMod::IGameHelpers::FindServerClass ( const char *  classname)
pure virtual

Finds a named server class.

Returns
ServerClass pointer on success, NULL on failure.
virtual const char* SourceMod::IGameHelpers::GetCurrentMap ( )
pure virtual

Returns the current map name.

Returns
Current map name.
virtual datamap_t* SourceMod::IGameHelpers::GetDataMap ( CBaseEntity *  pEntity)
pure virtual

Retrieves an entity's datamap_t pointer.

Parameters
pEntityCBaseEntity entity.
Returns
datamap_t pointer, or NULL on failure.
virtual const char* SourceMod::IGameHelpers::GetEntityClassname ( edict_t *  pEdict)
pure virtual

Gets a Classname from an edict_t pointer.

Parameters
pEdictedict_t pointer.
Returns
Pointer to the string, or NULL if bad pointer.
virtual const char* SourceMod::IGameHelpers::GetEntityClassname ( CBaseEntity *  pEntity)
pure virtual

Gets a Classname from an CBaseEntity pointer.

Parameters
pEntityCBaseEntity pointer.
Returns
Pointer to the string, or NULL if bad pointer.
virtual void* SourceMod::IGameHelpers::GetGlobalEntityList ( )
pure virtual

Returns the g_EntList pointer.

Returns
g_EntList pointer.
virtual edict_t* SourceMod::IGameHelpers::GetHandleEntity ( CBaseHandle &  hndl)
pure virtual

Retrieves the edict pointer from a CBaseHandle object.

Parameters
hndlCBaseHandle object.
Returns
Edict pointer or NULL on failure.
virtual int SourceMod::IGameHelpers::GetSendPropOffset ( SendProp *  prop)
pure virtual

Returns the uncomputed offset of a SendProp.

Parameters
propSendProp pointer.
Returns
Uncomputed sendprop offset.
virtual ICommandLine* SourceMod::IGameHelpers::GetValveCommandLine ( )
pure virtual

Retrieves the Valve command line pointer.

Returns
ICommandLine ptr or NULL if not found.
virtual bool SourceMod::IGameHelpers::HintTextMsg ( int  client,
const char *  msg 
)
pure virtual

Sends a hint message to a client.

Parameters
clientClient index.
msgMessage to send.
Returns
True on success, false on failure.
virtual int SourceMod::IGameHelpers::IndexOfEdict ( edict_t *  pEnt)
pure virtual

Converts an edict pointer into an entity index.

Parameters
indexEdict Pointer.
Returns
Entity index or -1 on failure.
virtual cell_t SourceMod::IGameHelpers::IndexToReference ( int  entIndex)
pure virtual

Converts an entity index into an entity reference.

Parameters
entIndexEntity index.
Returns
Entity reference.
virtual bool SourceMod::IGameHelpers::IsLANServer ( )
pure virtual

Returns whether the server ls a LAN server.

Returns
True if LAN server, false otherwise.
virtual bool SourceMod::IGameHelpers::IsMapValid ( const char *  map)
pure virtual

Returns whether or not a map name is valid to use with the engine's Changelevel functionality. It need not be an exact filename on some engines. For a check on the exact name, use IVEngineServer::IsMapValid.

Parameters
mapMap name.
Returns
True if valid, otherwise false.
virtual cell_t SourceMod::IGameHelpers::ReferenceToBCompatRef ( cell_t  entRef)
pure virtual

Converts a reference into a bcompat version (index for networked entities).

Parameters
entRefEntity reference.
Returns
Entity reference/index.
virtual CBaseEntity* SourceMod::IGameHelpers::ReferenceToEntity ( cell_t  entRef)
pure virtual

Looks up a reference and returns the CBasseEntity* it points to.

Note
Supports 'old style' simple indexes and does a serial confirmation check on references.
Parameters
entRefEntity reference.
Returns
Entity pointer.
virtual int SourceMod::IGameHelpers::ReferenceToIndex ( cell_t  entRef)
pure virtual

Retrieves the entity index from a reference.

Parameters
entRefEntity reference.
Returns
Entity index.
virtual void SourceMod::IGameHelpers::ServerCommand ( const char *  buffer)
pure virtual

Wraps IVEngineServer::ServerCommand.

Parameters
bufferCommand buffer (does not auto
terminate).
virtual void SourceMod::IGameHelpers::SetEdictStateChanged ( edict_t *  pEdict,
unsigned short  offset 
)
pure virtual

Marks an edict as state changed for an offset.

Parameters
pEdictEdict pointer.
offsetOffset index.
virtual void SourceMod::IGameHelpers::SetHandleEntity ( CBaseHandle &  hndl,
edict_t *  pEnt 
)
pure virtual

Sets the edict pointer in a CBaseHandle object.

Parameters
hndlCBaseHandle object.
pEntEdict pointer.
virtual bool SourceMod::IGameHelpers::TextMsg ( int  client,
int  dest,
const char *  msg 
)
pure virtual

Sends a text message to a client.

Parameters
clientClient index.
destDestination on the HUD (see TEXTMSG_DEST defines above).
msgMessage to send.
Returns
True on success, false on failure.

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