NET_AddExtraSocket
0x001c9080 · 167 bytes · __cdecl
_Z18NET_AddExtraSocketi
Decompiled
undefined (1 param)
/* NET_AddExtraSocket(int) */
int NET_AddExtraSocket(int param_1)
{
int iVar1;
undefined1 uVar2;
iVar1 = DAT_003ac4f0;
CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>>::GrowVector
((CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>> *)&net_sockets,1);
CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>>::ShiftElementsRight
((CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>> *)&net_sockets,iVar1,1);
uVar2 = 0x10;
_V_memset((void *)(iVar1 * 0x10 + net_sockets),0,0x10);
OpenSocketInternal(iVar1,param_1,-1,"extra",1,(bool)uVar2);
CUtlVector<netpacket_s,CUtlMemory<netpacket_s,int>>::EnsureCount
((CUtlVector<netpacket_s,CUtlMemory<netpacket_s,int>> *)net_packets,iVar1 + 1);
CUtlVector<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,CUtlMemory<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,int>>
::EnsureCount((CUtlVector<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,CUtlMemory<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,int>>
*)&net_splitpackets,iVar1 + 1);
return iVar1;
}
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.