L L4D2node

CBaseClientState::ConnectInternal

0x001059f0 · 334 bytes · __thiscall

_ZN16CBaseClientState15ConnectInternalEPKcS1_i

Decompiled

undefined (4 params)

/* CBaseClientState::ConnectInternal(char const*, char const*, int) */

void __thiscall
CBaseClientState::ConnectInternal(CBaseClientState *this,char *param_1,char *param_2,int param_3)

{
  CUtlVector<Remote_t,CUtlMemory<Remote_t,int>> *this_00;
  char cVar1;
  undefined4 uVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  CUtlVector<Remote_t,CUtlMemory<Remote_t,int>> *this_01;
  Color local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  this_00 = (CUtlVector<Remote_t,CUtlMemory<Remote_t,int>> *)(this + 0x2c);
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  CUtlVector<Remote_t,CUtlMemory<Remote_t,int>>::RemoveAll(this_00);
  CAddressList::AddRemote((CAddressList *)this_00,param_1,"public");
  this_01 = this_00;
  CAddressList::AddRemote((CAddressList *)this_00,param_2,"private");
  if (realtime < *(float *)(this + 0x40) || realtime == *(float *)(this + 0x40)) {
    cVar1 = ShouldUseDirectConnectAddress((CBaseClientState *)this_01,(CAddressList *)param_2);
    if (cVar1 != '\0') {
      uVar2 = netadr_s::ToString((netadr_s *)(this + 0x44),false);
      local_24 = (Color)0x0;
      local_23 = 0xff;
      local_22 = 0;
      local_21 = 0xff;
      ConColorMsg(&local_24,"Adding direct connect IP to connection %s\n",uVar2);
      pcVar3 = (char *)netadr_s::ToString((netadr_s *)(this + 0x44),false);
      CAddressList::AddRemote((CAddressList *)this_00,pcVar3,"direct");
    }
  }
  *(int *)(this + 0x150) = param_3;
  (**(code **)(*(int *)this + 0x90))(this,1,0xffffffff,0);
  *(undefined4 *)(this + 0x24) = 0;
  *(undefined8 *)(this + 0x1c) = 0xc7efffffe0000000;
  *(int *)(this + 0x28) = (int)(60.0 / *(float *)(cl_resend._28_4_ + 0x2c));
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)