ConVar_Register
0x00247880 · 168 bytes · __cdecl
_Z15ConVar_RegisteriP23IConCommandBaseAccessor
Decompiled
undefined (2 params)
/* ConVar_Register(int, IConCommandBaseAccessor*) */
void ConVar_Register(int param_1,IConCommandBaseAccessor *param_2)
{
int *piVar1;
int *piVar2;
if ((g_pCVar != (int *)0x0) && (s_bRegistered == '\0')) {
s_bRegistered = 1;
s_nCVarFlag = param_1;
s_nDLLIdentifier = (**(code **)(*g_pCVar + 0x14))(g_pCVar);
ConCommandBase::s_pAccessor = (IConCommandBaseAccessor *)&s_DefaultAccessor;
piVar2 = ConCommandBase::s_pConCommandBases;
if (param_2 != (IConCommandBaseAccessor *)0x0) {
ConCommandBase::s_pAccessor = param_2;
}
while (piVar2 != (int *)0x0) {
piVar1 = (int *)piVar2[1];
(**(code **)(*piVar2 + 0x10))(piVar2,s_nCVarFlag);
(**(code **)(*piVar2 + 0x30))(piVar2);
piVar2 = piVar1;
}
(**(code **)(*g_pCVar + 0x70))(g_pCVar);
(**(code **)(*g_pCVar + 0x94))(g_pCVar);
ConCommandBase::s_pConCommandBases = (int *)0x0;
return;
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.