NET_CloseSocket
0x001c22e0 · 163 bytes · __regparm3
_Z15NET_CloseSocketii.part.33
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* NET_CloseSocket(int, int) [clone .part.33] */
void __regparm3 NET_CloseSocket(int param_1,int param_2)
{
int iVar1;
undefined4 uVar2;
int local_10;
iVar1 = (**(code **)(_g_pVCR + 0xc))();
if (iVar1 != 2) {
local_10 = close(param_1);
}
(**(code **)(_g_pVCR + 0x74))("closesocket",&local_10,4);
if (local_10 == -1) {
NET_GetLastError();
uVar2 = NET_ErrorString(net_error);
ConMsg("WARNING! NET_CloseSocket: %s\n",uVar2);
}
if ((-1 < param_2) && (iVar1 = param_2 * 0x10 + net_sockets, param_1 == *(int *)(iVar1 + 0xc))) {
*(undefined4 *)(iVar1 + 0xc) = 0;
*(undefined1 *)(iVar1 + 4) = 0;
}
(**(code **)(*(int *)g_pSteamSocketMgr + 0x10))(g_pSteamSocketMgr,param_2);
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.