L L4D2node

CNetChan::Setup

0x001af400 · 619 bytes · __thiscall

_ZN8CNetChan5SetupEiP8netadr_sPKcP18INetChannelHandler

Decompiled

undefined (5 params)

/* CNetChan::Setup(int, netadr_s*, char const*, INetChannelHandler*) */

void __thiscall
CNetChan::Setup(CNetChan *this,int param_1,netadr_s *param_2,char *param_3,
               INetChannelHandler *param_4)

{
  double dVar1;
  char cVar2;
  CNetChan *pCVar3;
  int iVar4;
  
  *(int *)(this + 0x8c) = param_1;
  if (*(int *)(this + 0x90) != 0) {
    NET_CloseSocket(*(int *)(this + 0x90),-1);
    *(undefined4 *)(this + 0x90) = 0;
  }
  if (param_2 == (netadr_s *)0x0) {
    netadr_s::Clear((netadr_s *)(this + 0x98));
    netadr_s::SetType((netadr_s *)(this + 0x98),0);
  }
  else {
    *(undefined4 *)(this + 0x98) = *(undefined4 *)param_2;
    *(undefined4 *)(this + 0x9c) = *(undefined4 *)(param_2 + 4);
    *(undefined2 *)(this + 0xa0) = *(undefined2 *)(param_2 + 8);
  }
  dVar1 = net_time;
  *(double *)(this + 0xa8) = net_time;
  *(float *)(this + 0xa4) = (float)dVar1;
  V_strncpy((char *)(this + 0x41e0),param_3,0x20);
  *(INetChannelHandler **)(this + 0x4208) = param_4;
  *(undefined4 *)(this + 0x4220) = 0;
  (**(code **)(*(int *)this + 0x104))(this,0,4000,0);
  (**(code **)(*(int *)this + 0x104))(this,0,4000,1);
  (**(code **)(*(int *)this + 0x104))(this,1,0x37aa0,0);
  *(undefined4 *)(this + 0xb0) = 10000;
  iVar4 = 0;
  *(undefined4 *)(this + 0x4204) = 0x43960000;
  *(undefined4 *)(this + 8) = 1;
  *(undefined4 *)(this + 0xc) = 0;
  *(undefined4 *)(this + 0x10) = 0;
  *(undefined4 *)(this + 0x14) = 0;
  *(undefined4 *)(this + 0x18) = 0;
  *(undefined4 *)(this + 0x1c) = 0;
  *(undefined8 *)(this + 0xb4) = 0;
  *(undefined4 *)(this + 0x4200) = 0;
  *(undefined4 *)(this + 0x90) = 0;
  this[0x42a] = (CNetChan)0x0;
  *(undefined4 *)(this + 0x1ec) = 0;
  *(undefined4 *)(this + 0x31c) = 0;
  pCVar3 = this;
  do {
    *(int *)(pCVar3 + 0x35c) = iVar4;
    iVar4 = iVar4 + 1;
    *(undefined4 *)(pCVar3 + 0x358) = 0;
    *(undefined4 *)(pCVar3 + 0x354) = 0xffffffff;
    *(undefined4 *)(pCVar3 + 0x34c) = 0;
    *(undefined4 *)(pCVar3 + 0x344) = 0xffffffff;
    *(undefined4 *)(pCVar3 + 0x350) = 0;
    *(undefined4 *)(pCVar3 + 0x348) = 0xffffffff;
    pCVar3 = pCVar3 + 0x1c;
  } while (iVar4 != 8);
  (**(code **)(*(int *)this + 0x80))(this);
  cVar2 = NET_IsMultiplayer();
  if (cVar2 == '\0') {
    *(undefined4 *)(this + 0x94) = 0x37aa0;
  }
  else {
    *(undefined4 *)(this + 0x94) = *(undefined4 *)(net_blocksize._28_4_ + 0x30);
  }
  FlowReset(this);
                    /* WARNING: Could not recover jumptable at 0x001af60b. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(**(int **)(this + 0x4208) + 8))();
  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)