L L4D2node

CHLTVClient::SendSnapshot

0x001684e0 · 1531 bytes · __thiscall

_ZN11CHLTVClient12SendSnapshotEP12CClientFrame

Decompiled

undefined (2 params)

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

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

{
  uint *puVar1;
  CFrameSnapshot *this_00;
  int *piVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  char cVar5;
  char cVar6;
  uchar *puVar7;
  int iVar8;
  int iVar9;
  CFrameSnapshot *this_01;
  int local_a4;
  undefined4 local_94;
  undefined4 local_90;
  bf_write local_8c [16];
  char local_7c;
  undefined **local_74;
  undefined1 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined8 local_50;
  undefined4 local_48;
  undefined4 local_44;
  undefined1 local_40;
  undefined8 local_3c;
  undefined4 local_34;
  undefined4 local_30;
  int local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_94 = 0;
  local_90 = 0;
  if (_Plat_SetBenchmarkMode == 0) {
    local_a4 = 0;
  }
  else {
    (**(code **)(_Plat_SetBenchmarkMode + 0x50))
              (_Plat_SetBenchmarkMode,&local_94,0,0,0,0,"/data/src/engine/./hltvclient.cpp",0x1a4,
               &SendSnapshot(CClientFrame*)::tm_fmt,"(%s)%s",&DAT_002b07c7,
               "CHLTVClient::SendSnapshot");
    local_a4 = _Plat_SetBenchmarkMode;
  }
  uVar4 = local_90;
  uVar3 = local_94;
  iVar9 = _DAT_0040b9d4;
                    /* try { // try from 00168696 to 001686f6 has its CatchHandler @ 00168ba5 */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
    if ((char *)*_DAT_0040b030 != "CHLTVClient::SendSnapshot") {
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2b07ad,(char *)0x0,0x2b07c7);
    }
    puVar1 = (uint *)(_DAT_0040b0bc + 4 + _DAT_0040b030[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
                    /* try { // try from 001685b0 to 001685b4 has its CatchHandler @ 00168ba9 */
  puVar7 = (uchar *)NET_AllocPayload();
                    /* try { // try from 001685e0 to 00168619 has its CatchHandler @ 00168bb0 */
  bf_write::bf_write(local_8c,"CHLTVClient::SendSnapshot",puVar7,0x37aa0,-1);
  if ((*(int *)(param_1 + 0x118) == *(int *)(this + 0xfc)) || (0 < *(int *)(this + 0x210))) {
    (**(code **)(**(int **)(this + 0xe8) + 0xc4))(*(int **)(this + 0xe8),0);
    goto LAB_0016861a;
  }
                    /* try { // try from 00168787 to 00168817 has its CatchHandler @ 00168bb0 */
  iVar9 = (**(code **)(*(int *)this + 0xe0))(this,*(undefined4 *)(this + 0xf0));
  iVar8 = (**(code **)(*(int *)this + 0xe0))(this,*(undefined4 *)(this + 0x1d704));
  if ((iVar8 == 0) || (iVar8 = *(int *)(iVar8 + 0x114), iVar8 == 0)) {
LAB_00168822:
    local_28 = *(int *)(param_1 + 8);
  }
  else {
    local_28 = *(int *)(param_1 + 8);
    if (*(int *)(iVar8 + 8) <= local_28) {
      do {
        (**(code **)(**(int **)(this + 0xe8) + 0xac))(*(int **)(this + 0xe8),iVar8 + 0x134,1);
        if (iVar9 != 0) {
          (**(code **)(**(int **)(this + 0xe8) + 0xac))(*(int **)(this + 0xe8),iVar8 + 0x14c,0);
        }
        iVar8 = *(int *)(iVar8 + 0x114);
        if (iVar8 == 0) goto LAB_00168822;
        local_28 = *(int *)(param_1 + 8);
      } while (*(int *)(iVar8 + 8) <= local_28);
    }
  }
  local_60 = 0;
  local_50 = 0;
  local_3c = 0;
  local_24 = host_frametime_unbounded;
  local_68 = 0;
  local_64 = 0;
  local_58 = 0;
  local_54 = 0;
  local_48 = 0;
  local_44 = 0;
  local_40 = 0;
  local_34 = 0;
  local_30 = 0;
  local_6c = 0;
  local_74 = &PTR__NET_Tick_002a1b28;
  local_70 = 0;
  local_20 = host_frametime_stddeviation;
                    /* try { // try from 001688b3 to 001689d7 has its CatchHandler @ 00168af8 */
  NET_Tick::WriteToBuffer((NET_Tick *)&local_74,local_8c);
  iVar8 = (**(code **)(*(int *)this + 0x5c))(this);
  CNetworkStringTableContainer::WriteUpdateMessage
            (*(CNetworkStringTableContainer **)(*(int *)(this + 0xb8) + 0xbc),(CBaseClient *)0x0,
             iVar8,local_8c);
  (**(code **)(**(int **)(this + 0xb8) + 0x9c))(*(int **)(this + 0xb8),this,param_1,iVar9,local_8c);
  if (local_7c == '\0') {
LAB_0016894c:
    this_00 = *(CFrameSnapshot **)(param_1 + 0x118);
    this_01 = *(CFrameSnapshot **)(this + 0xfc);
    if (this_00 != this_01) {
      if (this_00 != (CFrameSnapshot *)0x0) {
        CFrameSnapshot::AddReference(this_00);
        this_01 = *(CFrameSnapshot **)(this + 0xfc);
      }
      if (this_01 != (CFrameSnapshot *)0x0) {
        CFrameSnapshot::ReleaseReference(this_01);
      }
      *(CFrameSnapshot **)(this + 0xfc) = this_00;
    }
    *(undefined4 *)(this + 0x1d704) = *(undefined4 *)(param_1 + 8);
    if (this[0x214] == (CHLTVClient)0x0) {
      piVar2 = *(int **)(this + 0xe8);
      if (iVar9 == 0) {
        cVar6 = (**(code **)(*piVar2 + 0xac))(piVar2,local_8c,1);
        cVar5 = '\0';
        if (cVar6 != '\0') {
          cVar5 = (**(code **)(**(int **)(this + 0xe8) + 0xc4))(*(int **)(this + 0xe8),0);
        }
        *(undefined4 *)(this + 0x210) = *(undefined4 *)(param_1 + 8);
      }
      else {
        iVar9 = (**(code **)(*piVar2 + 0xc0))(piVar2,local_8c);
        cVar5 = 0 < iVar9;
      }
      if (cVar5 == '\0') {
        (**(code **)(*(int *)this + 0x3c))(this,"ERROR! Couldn\'t send snapshot.");
      }
      local_74 = &PTR__INetMessage_002a1188;
      NET_FreePayload(puVar7);
      iVar9 = _DAT_0040b9d4;
      if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
         (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
        cVar5 = CVProfNode::ExitScope();
        if (cVar5 != '\0') {
          _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
        }
        DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
      }
      if (local_a4 == 0) {
        return;
      }
      (**(code **)(local_a4 + 0x54))(local_a4,uVar3,uVar4,0,0,0);
      return;
    }
    *(undefined4 *)(this + 0xf0) = *(undefined4 *)(param_1 + 8);
  }
  else {
    if (iVar9 != 0) {
      ConMsg("WARNING: msg overflowed for %s\n",this + 0x3c);
      bf_write::Reset(local_8c);
      goto LAB_0016894c;
    }
                    /* try { // try from 00168aab to 00168af5 has its CatchHandler @ 00168af8 */
    (**(code **)(*(int *)this + 0x3c))(this,"ERROR! Reliable snapshot overflow.");
  }
  local_74 = &PTR__INetMessage_002a1188;
LAB_0016861a:
  NET_FreePayload(puVar7);
  iVar9 = _DAT_0040b9d4;
  if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
     (iVar8 = ThreadGetCurrentId(), iVar9 == iVar8)) {
    cVar5 = CVProfNode::ExitScope();
    if (cVar5 != '\0') {
      _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
    }
    DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
  }
  if (local_a4 != 0) {
    (**(code **)(local_a4 + 0x54))(local_a4,uVar3,uVar4,0,0,0);
  }
  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)