report_entities
0x0067e510 · 438 bytes · __cdecl
_ZL15report_entitiesRK8CCommand
Decompiled
undefined (1 param)
/* report_entities(CCommand const&) */
void report_entities(CCommand *param_1)
{
CBaseEntity *pCVar1;
int iVar2;
int iVar3;
char *pcVar4;
int iVar5;
int local_58;
int local_54;
char *local_50;
CBaseEntity *local_40;
int local_3c [6];
undefined1 local_24;
undefined4 local_20;
local_3c[0] = 0;
local_3c[1] = 0;
local_3c[2] = 0;
local_3c[3] = 0;
local_3c[4] = 0;
local_3c[5] = 0;
local_24 = 0;
local_20 = 0;
if ((gEntList._65540_4_ != 0) &&
(pCVar1 = *(CBaseEntity **)gEntList._65540_4_, pCVar1 != (CBaseEntity *)0x0)) {
do {
local_40 = pCVar1;
/* try { // try from 0067e57a to 0067e6b9 has its CatchHandler @ 0067e6d6 */
CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess>::Insert
((CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess> *)local_3c,
&local_40);
pCVar1 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar1);
} while (pCVar1 != (CBaseEntity *)0x0);
iVar3 = local_3c[3];
if (local_3c[3] < 1) {
local_58 = 0;
}
else {
local_54 = 0;
iVar5 = 0;
local_50 = "";
local_58 = 0;
do {
while (iVar2 = *(int *)(local_3c[0] + iVar5 * 4), iVar2 == 0) {
LAB_0067e5c7:
iVar5 = iVar5 + 1;
if (iVar3 <= iVar5) goto LAB_0067e61f;
}
pcVar4 = *(char **)(iVar2 + 0x7c);
local_58 = (local_58 + 1) - (uint)(*(int *)(iVar2 + 0x30) == 0);
if (pcVar4 == (char *)0x0) {
pcVar4 = "";
}
if ((local_50 == pcVar4) ||
(iVar2 = _V_stricmp(pcVar4,local_50), iVar3 = local_3c[3], iVar2 == 0)) {
local_54 = local_54 + 1;
goto LAB_0067e5c7;
}
if (local_54 != 0) {
Msg("Class: %s (%d)\n",local_50,local_54);
}
iVar5 = iVar5 + 1;
local_54 = 1;
iVar3 = local_3c[3];
local_50 = pcVar4;
} while (iVar5 < local_3c[3]);
LAB_0067e61f:
if ((*local_50 != '\0') && (local_54 != 0)) {
Msg("Class: %s (%d)\n",local_50,local_54);
iVar3 = local_3c[3];
}
}
if (iVar3 != 0) {
Msg("Total %d entities (%d empty, %d edicts)\n",iVar3,local_20,local_58);
}
}
local_3c[3] = 0;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_3c);
local_3c[4] = local_3c[0];
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_3c);
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.