EventList_AddEventEntry
0x0044c3b0 · 322 bytes · __cdecl
_Z23EventList_AddEventEntryPKcibi
Decompiled
undefined (4 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* EventList_AddEventEntry(char const*, int, bool, int) */
int * EventList_AddEventEntry(char *param_1,int param_2,bool param_3,int param_4)
{
int iVar1;
int iVar2;
undefined2 uVar3;
int iVar4;
int iVar5;
int *piVar6;
iVar2 = DAT_00f7a01c;
iVar4 = DAT_00f7a01c + 1;
if ((iVar4 <= DAT_00f7a014) || (DAT_00f7a018 < 0)) goto LAB_0044c3dd;
if (DAT_00f7a018 == 0) {
if (DAT_00f7a014 == 0) {
if (iVar4 < 4) {
DAT_00f7a014 = 3;
goto LAB_0044c486;
}
DAT_00f7a014 = 3;
}
do {
DAT_00f7a014 = DAT_00f7a014 * 2;
} while (DAT_00f7a014 < iVar4);
}
else {
for (DAT_00f7a014 = (DAT_00f7a01c / DAT_00f7a018 + 1) * DAT_00f7a018; DAT_00f7a014 < iVar4;
DAT_00f7a014 = (DAT_00f7a014 + iVar4) / 2) {
}
}
LAB_0044c486:
if (g_EventList == (void *)0x0) {
g_EventList = malloc(DAT_00f7a014 * 0xc);
}
else {
g_EventList = realloc(g_EventList,DAT_00f7a014 * 0xc);
iVar4 = DAT_00f7a01c + 1;
}
LAB_0044c3dd:
iVar1 = (iVar4 - iVar2) + -1;
iVar5 = iVar2 * 0xc;
DAT_00f7a01c = iVar4;
_DAT_00f7a020 = g_EventList;
if (0 < iVar1) {
_V_memmove((void *)((int)g_EventList + iVar5 + 0xc),(void *)((int)g_EventList + iVar5),
iVar1 * 0xc);
}
piVar6 = (int *)(iVar5 + (int)g_EventList);
*piVar6 = param_2;
uVar3 = CStringRegistry::AddString((CStringRegistry *)&g_EventStrings,param_1,iVar2);
*(undefined2 *)(piVar6 + 2) = uVar3;
iVar4 = g_HighestEvent;
*(ushort *)((int)piVar6 + 10) = (ushort)param_3;
piVar6[1] = param_4;
if (iVar4 < param_2) {
g_HighestEvent = param_2;
}
return piVar6;
}
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.