NET_FindNetChannel
0x001c2700 · 213 bytes · __cdecl
_Z18NET_FindNetChanneliR8netadr_s
Decompiled
undefined (2 params)
/* NET_FindNetChannel(int, netadr_s&) */
undefined8 NET_FindNetChannel(int param_1,netadr_s *param_2)
{
int iVar1;
uint uVar2;
char cVar3;
uint uVar4;
int iVar5;
netadr_s *pnVar6;
int *piVar7;
int iVar8;
bool bVar9;
uVar4 = ThreadGetCurrentId();
if (uVar4 != DAT_003ac4b4) {
LOCK();
bVar9 = DAT_003ac4b4 != 0;
uVar2 = uVar4;
if (bVar9) {
uVar2 = DAT_003ac4b4;
}
DAT_003ac4b4 = uVar2;
UNLOCK();
if (bVar9) {
CThreadFastMutex::Lock(0x3ac4b4,uVar4);
goto LAB_001c2736;
}
}
DAT_003ac4b8 = DAT_003ac4b8 + 1;
LAB_001c2736:
iVar1 = DAT_003ac4ac;
if (0 < DAT_003ac4ac) {
iVar8 = 0;
do {
piVar7 = *(int **)(s_NetChannels + iVar8 * 4);
/* try { // try from 001c275c to 001c2788 has its CatchHandler @ 001c27e0 */
iVar5 = (**(code **)(*piVar7 + 0xd4))(piVar7);
if (iVar5 == param_1) {
pnVar6 = (netadr_s *)(**(code **)(*piVar7 + 200))(piVar7);
cVar3 = netadr_s::CompareAdr(param_2,pnVar6,false);
if (cVar3 != '\0') goto LAB_001c279a;
}
iVar8 = iVar8 + 1;
} while (iVar8 != iVar1);
}
piVar7 = (int *)0x0;
LAB_001c279a:
DAT_003ac4b8 = DAT_003ac4b8 - 1;
uVar4 = DAT_003ac4b8;
if (DAT_003ac4b8 == 0) {
LOCK();
UNLOCK();
uVar4 = DAT_003ac4b4;
DAT_003ac4b4 = 0;
}
return CONCAT44(uVar4,piVar7);
}
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.