L L4D2node

NET_ProcessCommandLine

0x001c2390 · 486 bytes · __cdecl

_Z22NET_ProcessCommandLineb

Decompiled

undefined (1 param)

/* NET_ProcessCommandLine(bool) */

void NET_ProcessCommandLine(bool param_1)

{
  int *piVar1;
  int iVar2;
  undefined1 *puVar3;
  undefined *puVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined *puVar7;
  
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-nodns");
  if (iVar2 != 0) {
    net_nodns = 1;
  }
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-usetcp");
  if (iVar2 != 0) {
    net_notcp = 0;
  }
  if (param_1) {
    piVar1 = (int *)CommandLine_Tier0();
    iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-nohltv");
    if (iVar2 == 0) {
      piVar1 = (int *)CommandLine_Tier0();
      iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002bbd5a);
      if (iVar2 == 0) {
        piVar1 = (int *)CommandLine_Tier0();
        iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1,"+tv_port",0);
        if (iVar2 == 0) goto LAB_001c23e9;
      }
      net_hltv = 1;
      goto LAB_001c23e9;
    }
  }
  net_hltv = 0;
LAB_001c23e9:
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-noip");
  if (iVar2 != 0) {
    net_noip = 1;
  }
  puVar3 = (undefined1 *)CommandLine_Tier0();
  puVar7 = &DAT_002bbd34;
  puVar4 = (undefined *)(**(code **)(*(int *)puVar3 + 0x18))(puVar3,&DAT_002bbd34,0);
  if (puVar4 != (undefined *)0x0) {
    puVar3 = ipname;
    ConVar::SetValue(ipname);
    puVar7 = puVar4;
  }
  uVar5 = *(undefined4 *)(hostport._28_4_ + 0x30);
  piVar1 = (int *)CommandLine_Tier0(puVar3,puVar7);
  uVar5 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-port",uVar5);
  piVar1 = (int *)CommandLine_Tier0();
  uVar5 = (**(code **)(*piVar1 + 0x1c))(piVar1,"+port",uVar5);
  piVar1 = (int *)CommandLine_Tier0();
  uVar6 = (**(code **)(*piVar1 + 0x1c))(piVar1,"+hostport",uVar5);
  puVar3 = hostport;
  ConVar::SetValue(0x3ac920);
  uVar5 = *(undefined4 *)(clientport._28_4_ + 0x30);
  piVar1 = (int *)CommandLine_Tier0(puVar3,uVar6);
  uVar6 = (**(code **)(*piVar1 + 0x1c))(piVar1,"+clientport",uVar5);
  puVar3 = clientport;
  ConVar::SetValue(0x3ac800);
  uVar5 = *(undefined4 *)(hltvport._28_4_ + 0x30);
  piVar1 = (int *)CommandLine_Tier0(puVar3,uVar6);
  (**(code **)(*piVar1 + 0x1c))(piVar1,"+tv_port",uVar5);
  ConVar::SetValue(0x3ac7a0);
  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)