ActivityList_AddActivityEntry
0x003ed640 · 317 bytes · __cdecl
_Z29ActivityList_AddActivityEntryPKcib
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ActivityList_AddActivityEntry(char const*, int, bool) */
int * ActivityList_AddActivityEntry(char *param_1,int param_2,bool param_3)
{
int iVar1;
int iVar2;
undefined2 uVar3;
int iVar4;
int iVar5;
int *piVar6;
iVar2 = DAT_00f72d70;
iVar5 = DAT_00f72d70 + 1;
if ((iVar5 <= DAT_00f72d68) || (DAT_00f72d6c < 0)) goto LAB_003ed66d;
if (DAT_00f72d6c == 0) {
iVar4 = DAT_00f72d68;
if (DAT_00f72d68 == 0) {
if (iVar5 < 5) {
DAT_00f72d68 = 4;
goto LAB_003ed71f;
}
iVar4 = 4;
}
do {
DAT_00f72d68 = iVar4 * 2;
if (iVar5 <= DAT_00f72d68) break;
DAT_00f72d68 = iVar4 * 4;
iVar4 = DAT_00f72d68;
} while (DAT_00f72d68 < iVar5);
}
else {
for (DAT_00f72d68 = (DAT_00f72d70 / DAT_00f72d6c + 1) * DAT_00f72d6c; DAT_00f72d68 < iVar5;
DAT_00f72d68 = (DAT_00f72d68 + iVar5) / 2) {
}
}
LAB_003ed71f:
if (g_ActivityList == (void *)0x0) {
g_ActivityList = malloc(DAT_00f72d68 << 3);
}
else {
g_ActivityList = realloc(g_ActivityList,DAT_00f72d68 << 3);
iVar5 = DAT_00f72d70 + 1;
}
LAB_003ed66d:
iVar4 = (iVar5 - iVar2) + -1;
iVar1 = iVar2 * 8;
DAT_00f72d70 = iVar5;
_DAT_00f72d74 = g_ActivityList;
if (0 < iVar4) {
_V_memmove((void *)((int)g_ActivityList + iVar1 + 8),(void *)((int)g_ActivityList + iVar1),
iVar4 * 8);
}
piVar6 = (int *)(iVar1 + (int)g_ActivityList);
*piVar6 = param_2;
uVar3 = CStringRegistry::AddString((CStringRegistry *)&g_ActivityStrings,param_1,iVar2);
iVar5 = g_HighestActivity;
*(undefined2 *)(piVar6 + 1) = uVar3;
*(ushort *)((int)piVar6 + 6) = (ushort)param_3;
if (iVar5 < param_2) {
g_HighestActivity = 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.