L L4D2node

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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)