L L4D2node

NET_Init

0x001c9130 · 227 bytes · __cdecl

_Z8NET_Initb

Decompiled

undefined (1 param)

/* NET_Init(bool) */

void NET_Init(bool param_1)

{
  void *pvVar1;
  int iVar2;
  int iVar3;
  
  NET_ProcessCommandLine(param_1);
  iVar2 = DAT_003ac4f0;
  net_time = 0;
  if (DAT_003ac4f0 < 3) {
    iVar3 = 3 - DAT_003ac4f0;
    CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>>::GrowVector
              ((CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>> *)&net_sockets,iVar3);
    CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>>::ShiftElementsRight
              ((CUtlVector<netsocket_t,CUtlMemory<netsocket_t,int>> *)&net_sockets,iVar2,iVar3);
  }
  iVar2 = 0;
  CUtlVector<netpacket_s,CUtlMemory<netpacket_s,int>>::EnsureCount
            ((CUtlVector<netpacket_s,CUtlMemory<netpacket_s,int>> *)net_packets,3);
  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,3);
  do {
    pvVar1 = (void *)(iVar2 * 0x10 + net_sockets);
    (&s_pLagData)[iVar2] = 0;
    iVar2 = iVar2 + 1;
    _V_memset(pvVar1,0,0x10);
  } while (iVar2 != 3);
  if (!param_1) {
    NET_ClearLoopbackBuffers();
    NET_InitParanoidMode();
    return;
  }
  NET_SetDedicated();
  NET_InitParanoidMode();
  return;
}

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)