L L4D2node

CBaseClient::SendSnapshot

0x000fa970 · 2220 bytes · __thiscall

_ZN11CBaseClient12SendSnapshotEP12CClientFrame

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseClient::SendSnapshot(CClientFrame*) */

void __thiscall CBaseClient::SendSnapshot(CBaseClient *this,CClientFrame *param_1)

{
  uint *puVar1;
  CFrameSnapshot *this_00;
  char cVar2;
  char cVar3;
  int iVar4;
  undefined *puVar5;
  CFrameSnapshot *this_01;
  int iVar6;
  undefined4 uVar7;
  CBaseClient *pCVar8;
  undefined4 uVar9;
  int in_GS_OFFSET;
  bf_write *pbVar10;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_128;
  undefined4 local_124;
  bf_write *local_120;
  undefined4 local_11c;
  undefined4 local_118;
  bf_write *local_114;
  bf_write local_110 [12];
  int local_104;
  char local_100;
  undefined **local_f8;
  undefined1 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined8 local_e4;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined8 local_d4;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined1 local_c4;
  undefined8 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(int *)(param_1 + 0x118) == *(int *)(this + 0xfc)) || (0 < *(int *)(this + 0x210))) {
    pbVar10 = *(bf_write **)(this + 0xe8);
    (**(code **)(*(int *)pbVar10 + 0xc4))(pbVar10,0);
    goto LAB_000fa9be;
  }
  local_13c = 0;
  local_138 = 0;
  if (_Plat_SetBenchmarkMode == (bf_write *)0x0) {
    local_120 = (bf_write *)0x0;
  }
  else {
    (**(code **)(_Plat_SetBenchmarkMode + 0x50))
              (_Plat_SetBenchmarkMode,&local_13c,0,0,0,0,"/data/src/engine/./baseclient.cpp",0x4a7,
               &SendSnapshot(CClientFrame*)::tm_fmt,"(%s)%s","Networking","SendSnapshot");
    local_120 = _Plat_SetBenchmarkMode;
  }
  iVar4 = _DAT_0040b9d4;
  local_128 = local_13c;
  local_124 = local_138;
  if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
                    /* try { // try from 000faf66 to 000fafc6 has its CatchHandler @ 000fb264 */
    iVar6 = ThreadGetCurrentId();
    if (iVar4 == iVar6) {
      if (*(char **)_DAT_0040b030 != "SendSnapshot") {
        _DAT_0040b030 =
             (bf_write *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2b07ba,(char *)0x0,0x2a6193)
        ;
      }
      puVar1 = (uint *)(_DAT_0040b0bc + 4 + *(int *)(_DAT_0040b030 + 0x70) * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0040b02c = '\0';
    }
  }
  local_134 = 0;
  local_130 = 0;
  if (_g_Telemetry == (bf_write *)0x0) {
    local_114 = (bf_write *)0x0;
  }
  else {
                    /* try { // try from 000fab15 to 000fab17 has its CatchHandler @ 000fb2ec */
    (**(code **)(_g_Telemetry + 0x50))
              (_g_Telemetry,&local_134,0,0x32,0,0,"/data/src/engine/./baseclient.cpp",0x4a8,
               &SendSnapshot(CClientFrame*)::tm_fmt,&DAT_002c48a3,"SendSnapshot");
    local_114 = _g_Telemetry;
  }
  if (*(int *)(net_megasnapshot._28_4_ + 0x30) == 0) {
    pCVar8 = this + 0x224;
    iVar4 = 40000;
  }
  else {
    pCVar8 = this + 0x9e64;
    iVar4 = 80000;
  }
  local_11c = local_134;
  local_118 = local_130;
                    /* try { // try from 000fab78 to 000fab91 has its CatchHandler @ 000fb27c */
  bf_write::bf_write(local_110,"CBaseClient::SendSnapshot",pCVar8,iVar4,-1);
  iVar4 = (**(code **)(*(int *)this + 0xe0))(this,*(undefined4 *)(this + 0xf0));
  if (iVar4 == 0) {
    uVar9 = *(undefined4 *)(this + 0xf0);
                    /* try { // try from 000fb1b9 to 000fb1f9 has its CatchHandler @ 000fb27c */
    uVar7 = (**(code **)(*(int *)this + 0x1c))(this);
    V_snprintf(local_a0,0x80,"%s can\'t find frame from tick %d",uVar7,uVar9);
    OnRequestFullUpdate(this,local_a0);
  }
  local_ac = *(undefined4 *)(param_1 + 8);
  local_e4 = 0;
  local_d4 = 0;
  local_c0 = 0;
  local_ec = 0;
  local_a8 = host_frametime_unbounded;
  local_e8 = 0;
  local_dc = 0;
  local_d8 = 0;
  local_cc = 0;
  local_c8 = 0;
  local_c4 = 0;
  local_b8 = 0;
  local_b4 = 0;
  local_f0 = 0;
  local_f8 = &PTR__NET_Tick_002a1b28;
  local_f4 = 0;
  local_a4 = host_frametime_stddeviation;
  if (*(int *)(this + 0x1d6e4) != 0) {
    *(int *)(this + 0x1d6e8) = local_104;
    *(int *)(this + 0x1d6ec) = local_104;
  }
                    /* try { // try from 000fac80 to 000faeb2 has its CatchHandler @ 000fb2de */
  NET_Tick::WriteToBuffer((NET_Tick *)&local_f8,local_110);
  if (*(int *)(this + 0x1d6e4) != 0) {
                    /* try { // try from 000fb12f to 000fb19f has its CatchHandler @ 000fb2de */
    TraceNetworkData(this,local_110,"NET_Tick");
  }
  if (g_pLocalNetworkBackdoor == 0) {
                    /* try { // try from 000fb205 to 000fb227 has its CatchHandler @ 000fb2de */
    iVar6 = (**(code **)(*(int *)this + 0x5c))(this);
    CNetworkStringTableContainer::WriteUpdateMessage
              (*(CNetworkStringTableContainer **)(*(int *)(this + 0xb8) + 0xbc),this,iVar6,local_110
              );
  }
  iVar6 = 0;
  if (*(int *)(this + 0x1d6e4) != 0) {
    iVar6 = local_104;
  }
  (**(code **)(**(int **)(this + 0xb8) + 0x9c))(*(int **)(this + 0xb8),this,param_1,iVar4,local_110)
  ;
  if (*(int *)(this + 0x1d6e4) != 0) {
    TraceNetworkMsg(this,local_104 - iVar6,"Total Delta");
  }
  cVar2 = (**(code **)(**(int **)(this + 0xb8) + 0x68))(*(int **)(this + 0xb8));
  uVar9 = 0xff;
  if (cVar2 != '\0') {
    uVar9 = *(undefined4 *)(sv_multiplayer_maxtempentities._28_4_ + 0x30);
  }
  (**(code **)(**(int **)(this + 0xb8) + 0xa0))
            (*(int **)(this + 0xb8),this,*(undefined4 *)(param_1 + 0x118),
             *(undefined4 *)(this + 0xfc),local_110,uVar9);
  if (*(int *)(this + 0x1d6e4) != 0) {
    TraceNetworkData(this,local_110,"Temp Entities");
  }
  cVar2 = (**(code **)(**(int **)(this + 0xb8) + 0x68))(*(int **)(this + 0xb8));
  uVar9 = 0xff;
  if (cVar2 != '\0') {
    uVar9 = *(undefined4 *)(sv_multiplayer_maxsounds._28_4_ + 0x30);
  }
  pCVar8 = this;
  (**(code **)(*(int *)this + 0xdc))(this,local_110,uVar9);
  if (*(int *)(this + 0x1d6e4) != 0) {
    puVar5 = &DAT_002b6517;
    if (iVar4 == 0) {
      puVar5 = &DAT_0029fe20;
    }
    TraceNetworkMsg(this,0,"Finished [delta %s]",puVar5);
    pCVar8 = this;
    EndTrace((bf_write *)this);
  }
  if (local_100 == '\0') {
LAB_000fae22:
    this_00 = *(CFrameSnapshot **)(param_1 + 0x118);
    this_01 = *(CFrameSnapshot **)(this + 0xfc);
    if (this_00 != this_01) {
      if (this_00 != (CFrameSnapshot *)0x0) {
        pCVar8 = (CBaseClient *)this_00;
        CFrameSnapshot::AddReference(this_00);
        this_01 = *(CFrameSnapshot **)(this + 0xfc);
      }
      if (this_01 != (CFrameSnapshot *)0x0) {
        CFrameSnapshot::ReleaseReference(this_01);
        pCVar8 = (CBaseClient *)this_01;
      }
      *(CFrameSnapshot **)(this + 0xfc) = this_00;
    }
    pbVar10 = *(bf_write **)(this + 0xe8);
    if ((this[0x214] == (CBaseClient)0x0) || (pbVar10 != (bf_write *)0x0)) {
      if (iVar4 == 0) {
        cVar3 = (**(code **)(*(int *)pbVar10 + 0xac))(pbVar10,local_110,1);
        cVar2 = '\0';
        if (cVar3 != '\0') {
          pbVar10 = *(bf_write **)(this + 0xe8);
          cVar2 = (**(code **)(*(int *)pbVar10 + 0xc4))(pbVar10,0);
        }
        *(undefined4 *)(this + 0x210) = *(undefined4 *)(param_1 + 8);
      }
      else {
        iVar4 = (**(code **)(*(int *)pbVar10 + 0xc0))(pbVar10,local_110);
        cVar2 = 0 < iVar4;
      }
      if (cVar2 == '\0') {
        (**(code **)(*(int *)this + 0x3c))(this,"ERROR! Couldn\'t send snapshot.");
        pbVar10 = (bf_write *)this;
      }
      local_f8 = &PTR__INetMessage_002a1188;
      if (local_114 != (bf_write *)0x0) {
        pbVar10 = local_114;
        (**(code **)(local_114 + 0x54))(local_114,local_11c,local_118,0,0,0);
      }
      iVar4 = _DAT_0040b9d4;
      if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
        iVar6 = ThreadGetCurrentId();
        if (iVar4 == iVar6) {
          pbVar10 = _DAT_0040b030;
          cVar2 = CVProfNode::ExitScope();
          if (cVar2 != '\0') {
            _DAT_0040b030 = *(bf_write **)(_DAT_0040b030 + 100);
          }
          DAT_0040b02c = _DAT_0040b030 == (bf_write *)0x40b034;
        }
      }
      if (local_120 != (bf_write *)0x0) {
        pbVar10 = local_120;
        (**(code **)(local_120 + 0x54))(local_120,local_128,local_124,0,0,0);
      }
      goto LAB_000fa9be;
    }
    uVar9 = *(undefined4 *)(param_1 + 8);
    *(undefined4 *)(this + 0xf0) = uVar9;
    *(undefined4 *)(this + 0xf4) = uVar9;
    this = pCVar8;
  }
  else {
    if (iVar4 != 0) {
      ConMsg("WARNING: msg overflowed for %s\n",this + 0x3c);
      pCVar8 = (CBaseClient *)local_110;
      bf_write::Reset(local_110);
      goto LAB_000fae22;
    }
    (**(code **)(*(int *)this + 0x3c))(this,"ERROR! Reliable snaphsot overflow.");
  }
  local_f8 = &PTR__INetMessage_002a1188;
  pbVar10 = (bf_write *)this;
  if (local_114 != (bf_write *)0x0) {
    pbVar10 = local_114;
    (**(code **)(local_114 + 0x54))(local_114,local_11c,local_118,0,0,0);
  }
  iVar4 = _DAT_0040b9d4;
  if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
    iVar6 = ThreadGetCurrentId();
    if (iVar4 == iVar6) {
      pbVar10 = _DAT_0040b030;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0040b030 = *(bf_write **)(_DAT_0040b030 + 100);
      }
      DAT_0040b02c = _DAT_0040b030 == (bf_write *)0x40b034;
    }
  }
  if (local_120 != (bf_write *)0x0) {
    pbVar10 = local_120;
    (**(code **)(local_120 + 0x54))(local_120,local_128,local_124,0,0,0);
  }
LAB_000fa9be:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(pbVar10);
}

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)