SourceMod SDK  1.7
SourceMod::IExtensionInterface Class Referenceabstract

The interface an extension must expose. More...

#include <public/IExtensionSys.h>

Inheritance diagram for SourceMod::IExtensionInterface:
SDKExtension

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. More...
 
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. More...
 
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. More...
 
virtual void NotifyInterfaceDrop (SMInterface *pInterface)
 Notifies the extension that an external interface it uses is being removed. More...
 
virtual bool QueryRunning (char *error, size_t maxlength)
 Return false to tell Core that your extension should be considered unusable. More...
 
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. More...
 
virtual const char * GetExtensionName ()=0
 Must return a string containing the extension's short name. More...
 
virtual const char * GetExtensionURL ()=0
 Must return a string containing the extension's URL. More...
 
virtual const char * GetExtensionTag ()=0
 Must return a string containing a short identifier tag. More...
 
virtual const char * GetExtensionAuthor ()=0
 Must return a string containing a short author identifier. More...
 
virtual const char * GetExtensionVerString ()=0
 Must return a string containing version information. More...
 
virtual const char * GetExtensionDescription ()=0
 Must return a string containing description text. More...
 
virtual const char * GetExtensionDateString ()=0
 Must return a string containing the compilation date. More...
 
virtual void OnCoreMapStart (edict_t *pEdictList, int edictCount, int clientMax)
 Called on server activation before plugins receive the OnServerLoad forward. More...
 
virtual void OnDependenciesDropped ()
 Called once all dependencies have been unloaded. This is called AFTER OnExtensionUnload(), but before the extension library has been unloaded. It can be used as an alternate unload hook for cases where having no dependent plugins would make shutdown much simplier.
 
virtual void OnCoreMapEnd ()
 Called on level shutdown.
 

Detailed Description

The interface an extension must expose.

Member Function Documentation

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

Must return a string containing a short author identifier.

Returns
String containing extension author.

Implemented in 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 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 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 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 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 SDKExtension.

virtual unsigned int SourceMod::IExtensionInterface::GetExtensionVersion ( )
inlinevirtual

Returns the interface API version

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 SDKExtension.

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 SDKExtension.

virtual void SourceMod::IExtensionInterface::NotifyInterfaceDrop ( SMInterface pInterface)
inlinevirtual

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

Parameters
pInterfacePointer 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
virtual void SourceMod::IExtensionInterface::OnCoreMapStart ( edict_t *  pEdictList,
int  edictCount,
int  clientMax 
)
inlinevirtual

Called on server activation before plugins receive the OnServerLoad forward.

Parameters
pEdictListEdicts list.
edictCountNumber of edicts in the list.
clientMaxMaximum number of clients allowed in the server.
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
mePointer back to extension.
sysPointer to interface sharing system of SourceMod.
errorError buffer to print back to, if any.
maxlengthMaximum size of error buffer.
lateIf this extension was loaded "late" (i.e. manually).
Returns
True if load should continue, false otherwise.

Implemented in SDKExtension.

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

Called when your pause state is about to change.

Parameters
pauseTrue if pausing, false if unpausing.

Implemented in SDKExtension.

virtual bool SourceMod::IExtensionInterface::QueryInterfaceDrop ( SMInterface pInterface)
inlinevirtual

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
pInterfacePointer 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.
virtual bool SourceMod::IExtensionInterface::QueryRunning ( char *  error,
size_t  maxlength 
)
inlinevirtual

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

Parameters
errorError buffer.
maxlengthSize of error buffer.
Returns
True on success, false otherwise.

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