Filter_ShouldDiscard
0x001efd40 · 184 bytes · __cdecl
_Z20Filter_ShouldDiscardRK8netadr_s
Decompiled
undefined (1 param)
/* Filter_ShouldDiscard(netadr_s const&) */
bool Filter_ShouldDiscard(netadr_s *param_1)
{
int iVar1;
uint uVar2;
bool bVar3;
uint *puVar4;
int iVar5;
int iVar6;
iVar1 = *(int *)(sv_filterban._28_4_ + 0x30);
bVar3 = false;
if (iVar1 != 0) {
uVar2 = *(uint *)(param_1 + 4);
iVar5 = DAT_003b2460 + -1;
iVar6 = iVar5 * 0x10;
if (-1 < iVar5) {
do {
puVar4 = (uint *)(g_IPFilters + iVar6);
if (((puVar4[1] == 0xffffffff) || ((float)puVar4[2] == 0.0)) ||
(realtime < (float)puVar4[2])) {
if (puVar4[1] == (*puVar4 & uVar2)) {
return iVar1 == 1;
}
}
else {
CUtlVector<ipfilter_t,CUtlMemory<ipfilter_t,int>>::ShiftElementsLeft
((CUtlVector<ipfilter_t,CUtlMemory<ipfilter_t,int>> *)&g_IPFilters,iVar5,1);
DAT_003b2460 = DAT_003b2460 + -1;
}
iVar5 = iVar5 + -1;
iVar6 = iVar6 + -0x10;
} while (iVar5 != -1);
}
bVar3 = iVar1 != 1;
}
return bVar3;
}
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.