L L4D2node

NET_Config

0x001c7e80 · 352 bytes · unknown

_Z10NET_Configv

Decompiled

undefined (0 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* NET_Config() */

void NET_Config(void)

{
  undefined4 uVar1;
  undefined4 uVar2;
  char *pcVar3;
  CRConServer *pCVar4;
  undefined4 uVar5;
  int *piVar6;
  int iVar7;
  undefined *puVar8;
  undefined *puVar9;
  int in_GS_OFFSET;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  NET_CloseAllSockets();
  net_time = 0;
  if (net_multiplayer == '\0') {
    NET_ClearLoopbackBuffers();
  }
  else {
    NET_ClearLoopbackBuffers();
    NET_GetLocalAddress();
    NET_OpenSockets();
    if (net_dedicated == '\0') {
      piVar6 = (int *)CommandLine_Tier0();
      iVar7 = (**(code **)(*piVar6 + 0x28))(piVar6,"-usercon");
      if (iVar7 == 0) goto LAB_001c7f3d;
    }
    local_2c = net_local_adr;
    local_28 = _DAT_003ac14c;
    local_24 = DAT_003ac150;
    netadr_s::SetPort((netadr_s *)&local_2c,*(ushort *)(net_sockets + 4));
    pcVar3 = (char *)netadr_s::ToString((netadr_s *)&local_2c,false);
    pCVar4 = (CRConServer *)RCONServer();
    CRConServer::SetAddress(pCVar4,pcVar3);
    pCVar4 = (CRConServer *)RCONServer();
    CRConServer::CreateSocket(pCVar4);
  }
LAB_001c7f3d:
  puVar9 = &DAT_002bbfd0;
  puVar8 = &DAT_002bbfd7;
  uVar1 = *net_sockets;
  uVar2 = net_sockets[4];
  if (net_dedicated == '\0') {
    puVar9 = &DAT_002bbfd4;
  }
  if (net_multiplayer == '\0') {
    puVar8 = &DAT_002b9470;
  }
  uVar5 = netadr_s::ToString((netadr_s *)&net_local_adr,true);
  Msg("Network: IP %s, mode %s, dedicated %s, ports %i SV / %i CL\n",uVar5,puVar8,puVar9,uVar2,uVar1
     );
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)