CVScriptGameEventListener::FireGameEvent
0x00b48d00 · 962 bytes · __thiscall
_ZN25CVScriptGameEventListener13FireGameEventEP10IGameEvent
Decompiled
undefined (2 params)
/* CVScriptGameEventListener::FireGameEvent(IGameEvent*) */
void __thiscall
CVScriptGameEventListener::FireGameEvent(CVScriptGameEventListener *this,IGameEvent *param_1)
{
IScriptVM *pIVar1;
KeyValues *pKVar2;
undefined4 uVar3;
char *pcVar4;
HSCRIPT__ *pHVar5;
undefined4 uVar6;
HSCRIPT__ *pHVar7;
int in_GS_OFFSET;
longdouble lVar8;
undefined8 uVar9;
HSCRIPT__ *local_ac;
undefined4 local_a8;
undefined2 local_a4;
ushort local_a2;
HSCRIPT__ local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
pKVar2 = (KeyValues *)(**(code **)(*(int *)param_1 + 0x40))(param_1);
pIVar1 = g_pScriptVM;
if ((pKVar2 == (KeyValues *)0x0) || (g_pScriptVM == (IScriptVM *)0x0)) {
pHVar7 = (HSCRIPT__ *)0x0;
}
else {
local_ac = (HSCRIPT__ *)0x0;
local_a4 = 0;
local_a2 = 0;
/* try { // try from 00b48d77 to 00b48d7c has its CatchHandler @ 00b490f2 */
(**(code **)(*(int *)g_pScriptVM + 0x80))(g_pScriptVM,&local_ac);
pHVar7 = local_ac;
if ((local_a2 & 1) != 0) {
free(local_ac);
}
for (pKVar2 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar2); pKVar2 != (KeyValues *)0x0;
pKVar2 = (KeyValues *)KeyValues::GetNextKey(pKVar2)) {
local_a4 = 0;
local_a2 = 0;
local_ac = (HSCRIPT__ *)0x0;
/* try { // try from 00b48dd7 to 00b48e9e has its CatchHandler @ 00b490da */
uVar3 = KeyValues::GetDataType(pKVar2,(char *)0x0);
switch(uVar3) {
case 0:
pHVar5 = (HSCRIPT__ *)ScriptTableFromKeyValues(pIVar1,pKVar2,(HSCRIPT__ *)&DAT_ffffffff);
if ((local_a2 & 1) != 0) {
free(local_ac);
local_a2 = local_a2 & 0xfffe;
}
local_a4 = 0x20;
local_ac = pHVar5;
break;
case 1:
pHVar5 = (HSCRIPT__ *)KeyValues::GetString(pKVar2,(char *)0x0,"");
if ((local_a2 & 1) != 0) {
free(local_ac);
local_a2 = local_a2 & 0xfffe;
}
local_a4 = 0x1f;
local_ac = pHVar5;
break;
case 2:
pHVar5 = (HSCRIPT__ *)KeyValues::GetInt(pKVar2,(char *)0x0,0);
if ((local_a2 & 1) != 0) {
free(local_ac);
local_a2 = local_a2 & 0xfffe;
}
local_a4 = 5;
local_ac = pHVar5;
break;
case 3:
/* try { // try from 00b48f23 to 00b490cd has its CatchHandler @ 00b490da */
lVar8 = (longdouble)KeyValues::GetFloat(pKVar2,(char *)0x0,0.0);
if ((local_a2 & 1) != 0) {
free(local_ac);
local_a2 = local_a2 & 0xfffe;
}
local_a4 = 1;
local_ac = (HSCRIPT__ *)(float)lVar8;
break;
default:
uVar3 = KeyValues::GetDataType(pKVar2,(char *)0x0);
uVar6 = KeyValues::GetName(pKVar2);
Warning("ScriptVmKeyValueToVariant failed to package parameter %s (type %d)\n",uVar6,uVar3);
goto LAB_00b48e9f;
case 7:
uVar9 = KeyValues::GetUint64((char *)pKVar2,0);
V_snprintf((char *)local_a0,0x80,"%llu",(int)uVar9,(int)((ulonglong)uVar9 >> 0x20));
if ((local_a2 & 1) != 0) {
free(local_ac);
local_a2 = local_a2 & 0xfffe;
}
local_a4 = 0x1f;
local_ac = local_a0;
}
local_a8 = 0;
uVar3 = KeyValues::GetName(pKVar2);
(**(code **)(*(int *)pIVar1 + 0x78))(pIVar1,pHVar7,uVar3,&local_ac);
LAB_00b48e9f:
if ((local_a2 & 1) != 0) {
free(local_ac);
}
}
}
pcVar4 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
RunGameEventCallbacks(this,pcVar4,pHVar7);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.