NET_RemoveAllExtraSockets
0x001c4230 · 156 bytes · unknown
_Z25NET_RemoveAllExtraSocketsv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* NET_RemoveAllExtraSockets() */
void NET_RemoveAllExtraSockets(void)
{
int iVar1;
int iVar2;
int *piVar3;
int iVar4;
if (DAT_003ac4f0 < 4) {
DAT_003ac4f0 = 3;
return;
}
iVar4 = 3;
iVar2 = DAT_003ac4f0;
do {
while( true ) {
piVar3 = (int *)(net_sockets + iVar4 * 0x10);
if (*piVar3 != 0) break;
LAB_001c425d:
iVar4 = iVar4 + 1;
if (iVar2 <= iVar4) {
DAT_003ac4f0 = 3;
return;
}
}
if (piVar3[2] == 0) {
iVar1 = piVar3[3];
iVar2 = DAT_003ac4f0;
}
else {
NET_CloseSocket(piVar3[2],-1);
iVar1 = *(int *)(iVar4 * 0x10 + net_sockets + 0xc);
iVar2 = DAT_003ac4f0;
}
DAT_003ac4f0 = iVar2;
if (iVar1 == 0) goto LAB_001c425d;
iVar4 = iVar4 + 1;
NET_CloseSocket(iVar1,-1);
iVar2 = DAT_003ac4f0;
if (DAT_003ac4f0 <= iVar4) {
DAT_003ac4f0 = 3;
return;
}
} while( true );
}
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.