ISource2ModModules

The game's modules, owned by the core: every lookup of one library gives the same object, nobody allocates or frees one.

ISource2ModModule* server = g_pSource2ModModules->Get(Source2ModModuleId::Server);
ISource2ModModule* foo = g_pSource2ModModules->Get("foo");
ISource2ModModule* own = g_pSource2ModModules->GetFromAddress(g_pSource2Server);

Interface id ISource2ModModules001 (SOURCE2MOD_MODULES_INTERFACE) · Global g_pSource2ModModules · Header source2mod/ISource2ModModules.h

Methods

Get

virtual ISource2ModModule* Get(Source2ModModuleId id) = 0;
virtual ISource2ModModule* Get(const char* name) = 0;

One of the common modules; nullptr while it is not loaded.

A module by name, without the extension ("server", "engine2"); nullptr while it is not loaded.

ParameterType
idSource2ModModuleId
nameconst char*

GetFromAddress

virtual ISource2ModModule* GetFromAddress(const void* address) = 0;

The module an address lies in; nullptr when it lies in none.

ParameterType
addressconst void*

Enums

Source2ModModuleId

enum class Source2ModModuleId : int

The modules everybody needs. HookTarget::Class looks for a class in these, in this order.

NameValue
Server0
Engine
Tier0
VScript
SchemaSystem
NetworkSystem
ResourceSystem
FileSystem
SteamApi
Count

On this page