GetGameModeContext
0x0003d080 · 151 bytes · __cdecl
_Z18GetGameModeContextPKc
Decompiled
undefined (1 param)
/* GetGameModeContext(char const*) */
int GetGameModeContext(char *param_1)
{
code *pcVar1;
KeyValues *pKVar2;
int iVar3;
undefined4 uVar4;
pKVar2 = (KeyValues *)(**(code **)(*(int *)g_pMatchExtL4D + 0x10))(g_pMatchExtL4D,param_1);
iVar3 = 0;
if (pKVar2 != (KeyValues *)0x0) {
iVar3 = KeyValues::GetInt(pKVar2,"x360ctx",-1);
if (iVar3 == -1) {
pcVar1 = *(code **)(*(int *)g_pMatchExtL4D + 0x10);
uVar4 = KeyValues::GetString(pKVar2,"base",(char *)0x0);
pKVar2 = (KeyValues *)(*pcVar1)(g_pMatchExtL4D,uVar4);
iVar3 = KeyValues::GetInt(pKVar2,"x360ctx",0);
return iVar3;
}
}
return iVar3;
}
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.