SourceMod::IExtensionInterface Class Reference

The interface an extension must expose. More...

#include <public/IExtensionSys.h>

Inherited by MyExtension, and SDKExtension.

Inheritance diagram for SourceMod::IExtensionInterface:

[legend]
List of all members.

Public Member Functions

virtual unsigned int GetExtensionVersion ()
virtual bool OnExtensionLoad (IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late)=0
 Called when the extension is loaded.
virtual void OnExtensionUnload ()=0
 Called when the extension is about to be unloaded.
virtual void OnExtensionsAllLoaded ()=0
 Called when all extensions are loaded (loading cycle is done). If loaded late, this will be called right after OnExtensionLoad().
virtual void OnExtensionPauseChange (bool pause)=0
 Called when your pause state is about to change.
virtual bool QueryInterfaceDrop (SMInterface *pInterface)
 Asks the extension whether it's safe to remove an external interface it's using. If it's not safe, return false, and the extension will be unloaded afterwards.
virtual void NotifyInterfaceDrop (SMInterface *pInterface)
 Notifies the extension that an external interface it uses is being removed.
virtual bool QueryRunning (char *error, size_t maxlength)
 Return false to tell Core that your extension should be considered unusable.
virtual bool IsMetamodExtension ()=0
 For extensions loaded through SourceMod, this should return true if the extension needs to attach to Metamod:Source. If the extension is loaded through Metamod:Source, and uses SourceMod optionally, it must return false.
virtual const char * GetExtensionName ()=0
 Must return a string containing the extension's short name.
virtual const char * GetExtensionURL ()=0
 Must return a string containing the extension's URL.
virtual const char * GetExtensionTag ()=0
 Must return a string containing a short identifier tag.
virtual const char * GetExtensionAuthor ()=0
 Must return a string containing a short author identifier.
virtual const char * GetExtensionVerString ()=0
 Must return a string containing version information.
virtual const char * GetExtensionDescription ()=0
 Must return a string containing description text.
virtual const char * GetExtensionDateString ()=0
 Must return a string containing the compilation date.
virtual void OnCoreMapStart (edict_t *pEdictList, int edictCount, int clientMax)
 Called on server activation before plugins receive the OnServerLoad forward.

Detailed Description

The interface an extension must expose.

Definition at line 141 of file IExtensionSys.h.


Member Function Documentation

virtual unsigned int SourceMod::IExtensionInterface::GetExtensionVersion (  )  [inline, virtual]

Returns the interface API version

Definition at line 145 of file IExtensionSys.h.

virtual bool SourceMod::IExtensionInterface::OnExtensionLoad ( IExtension me,
IShareSys sys,
char *  error,
size_t  maxlength,
bool  late 
) [pure virtual]

Called when the extension is loaded.

Parameters:
me Pointer back to extension.
sys Pointer to interface sharing system of SourceMod.
error Error buffer to print back to, if any.
maxlength Maximum size of error buffer.
late If this extension was loaded "late" (i.e. manually).
Returns:
True if load should continue, false otherwise.

Implemented in MyExtension, and SDKExtension.

virtual void SourceMod::IExtensionInterface::OnExtensionPauseChange ( bool  pause  )  [pure virtual]

Called when your pause state is about to change.

Parameters:
pause True if pausing, false if unpausing.

Implemented in MyExtension, and SDKExtension.

virtual bool SourceMod::IExtensionInterface::QueryInterfaceDrop ( SMInterface pInterface  )  [inline, virtual]

Asks the extension whether it's safe to remove an external interface it's using. If it's not safe, return false, and the extension will be unloaded afterwards.

NOTE: It is important to also hook NotifyInterfaceDrop() in order to clean up resources.

Parameters:
pInterface Pointer to interface being dropped. This pointer may be opaque, and it should not be queried using SMInterface functions unless it can be verified to match an existing pointer of known type.
Returns:
True to continue, false to unload this extension afterwards.

Definition at line 200 of file IExtensionSys.h.

virtual void SourceMod::IExtensionInterface::NotifyInterfaceDrop ( SMInterface pInterface  )  [inline, virtual]

Notifies the extension that an external interface it uses is being removed.

Parameters:
pInterface Pointer to interface being dropped. This pointer may be opaque, and it should not be queried using SMInterface functions unless it can be verified to match an existing

Definition at line 213 of file IExtensionSys.h.

virtual bool SourceMod::IExtensionInterface::QueryRunning ( char *  error,
size_t  maxlength 
) [inline, virtual]

Return false to tell Core that your extension should be considered unusable.

Parameters:
error Error buffer.
maxlength Size of error buffer.
Returns:
True on success, false otherwise.

Reimplemented in MyExtension.

Definition at line 224 of file IExtensionSys.h.

virtual bool SourceMod::IExtensionInterface::IsMetamodExtension (  )  [pure virtual]

For extensions loaded through SourceMod, this should return true if the extension needs to attach to Metamod:Source. If the extension is loaded through Metamod:Source, and uses SourceMod optionally, it must return false.

Returns:
True if Metamod:Source is needed.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionName (  )  [pure virtual]

Must return a string containing the extension's short name.

Returns:
String containing extension name.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionURL (  )  [pure virtual]

Must return a string containing the extension's URL.

Returns:
String containing extension URL.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionTag (  )  [pure virtual]

Must return a string containing a short identifier tag.

Returns:
String containing extension tag.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionAuthor (  )  [pure virtual]

Must return a string containing a short author identifier.

Returns:
String containing extension author.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionVerString (  )  [pure virtual]

Must return a string containing version information.

Any version string format can be used, however, SourceMod makes a special guarantee version numbers in the form of A.B.C.D will always be fully displayed, where:

A is a major version number of at most one digit. B is a minor version number of at most two digits. C is a minor version number of at most two digits. D is a build number of at most 5 digits.

Thus, thirteen characters of display is guaranteed.

Returns:
String containing extension version.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionDescription (  )  [pure virtual]

Must return a string containing description text.

The description text may be longer than the other identifiers, as it is only displayed when viewing one extension at a time. However, it should not have newlines, or any other characters which would otherwise disrupt the display pattern.

Returns:
String containing extension description.

Implemented in MyExtension, and SDKExtension.

virtual const char* SourceMod::IExtensionInterface::GetExtensionDateString (  )  [pure virtual]

Must return a string containing the compilation date.

Returns:
String containing the compilation date.

Implemented in MyExtension, and SDKExtension.

virtual void SourceMod::IExtensionInterface::OnCoreMapStart ( edict_t *  pEdictList,
int  edictCount,
int  clientMax 
) [inline, virtual]

Called on server activation before plugins receive the OnServerLoad forward.

Parameters:
pEdictList Edicts list.
edictCount Number of edicts in the list.
clientMax Maximum number of clients allowed in the server.

Definition at line 311 of file IExtensionSys.h.


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 08:10:12 2008 for SourceMod SDK by  doxygen 1.5.1