L L4D2node

CHLTVServer::AddNewFrame

0x00173460 · 836 bytes · __thiscall

_ZN11CHLTVServer11AddNewFrameEP12CClientFrame

Decompiled

undefined (2 params)

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

CHLTVFrame * __thiscall CHLTVServer::AddNewFrame(CHLTVServer *this,CClientFrame *param_1)

{
  CClientFrame *this_00;
  uint *puVar1;
  undefined4 uVar2;
  char cVar3;
  CHLTVFrame *this_01;
  int iVar4;
  CSteam3Server *pCVar5;
  int iVar6;
  CClientFrame *pCVar7;
  CHLTVServer *pCVar8;
  byte bVar9;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  bVar9 = 0;
  local_34 = 0;
  local_30 = 0;
  if (_Plat_SetBenchmarkMode == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_Plat_SetBenchmarkMode + 0x50))
              (_Plat_SetBenchmarkMode,&local_34,0,0,0,0,"/data/src/engine/./hltvserver.cpp",0x526,
               &AddNewFrame(CClientFrame*)::tm_fmt,"(%s)%s",&DAT_002b07c7,"CHLTVServer::AddNewFrame"
              );
    local_20 = _Plat_SetBenchmarkMode;
  }
  iVar6 = _DAT_0040b9d4;
  local_28 = local_34;
  local_24 = local_30;
  if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
                    /* try { // try from 001736a6 to 00173706 has its CatchHandler @ 001737c1 */
    iVar4 = ThreadGetCurrentId();
    if (iVar6 == iVar4) {
      if ((char *)*_DAT_0040b030 != "CHLTVServer::AddNewFrame") {
        _DAT_0040b030 =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2b188a,(char *)0x0,0x2b07c7);
      }
      puVar1 = (uint *)(_DAT_0040b0bc + 4 + _DAT_0040b030[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0040b02c = '\0';
    }
  }
  *(undefined4 *)(this + 0x51c0) = *(undefined4 *)(param_1 + 8);
  this_00 = (CClientFrame *)(this + 0x51d0);
                    /* try { // try from 0017353b to 00173586 has its CatchHandler @ 001737ee */
  CClientFrame::SetSnapshot(this_00,*(CFrameSnapshot **)(param_1 + 0x118));
  *(undefined4 *)(this + 0x51d8) = *(undefined4 *)(param_1 + 8);
  *(undefined4 *)(this + 0x51d4) = *(undefined4 *)(param_1 + 4);
  pCVar7 = param_1 + 0xc;
  pCVar8 = this + 0x51dc;
  for (iVar6 = 0x40; iVar6 != 0; iVar6 = iVar6 + -1) {
    *(undefined4 *)pCVar8 = *(undefined4 *)pCVar7;
    pCVar7 = pCVar7 + (uint)bVar9 * -8 + 4;
    pCVar8 = pCVar8 + (uint)bVar9 * -8 + 4;
  }
  if (*(int *)(this + 0x51bc) < 0) {
    uVar2 = *(undefined4 *)(param_1 + 8);
    *(undefined4 *)(this + 0x51bc) = uVar2;
    *(undefined4 *)(this + 0x10) = uVar2;
    cVar3 = (**(code **)(*(int *)this + 0x54))(this);
    if (cVar3 == '\0') {
      *(undefined4 *)(this + 8) = 2;
      CBaseServer::ReconnectClients((CBaseServer *)(this + 4));
      ConMsg("SourceTV relay active.\n");
      pCVar5 = (CSteam3Server *)Steam3Server();
      CSteam3Server::Activate(pCVar5);
      pCVar5 = (CSteam3Server *)Steam3Server();
      CSteam3Server::SendUpdatedServerDetails(pCVar5);
    }
    else {
      ConMsg("SourceTV broadcast active.\n");
    }
  }
  this_01 = operator_new(0x1ac);
                    /* try { // try from 0017358c to 00173590 has its CatchHandler @ 001737d6 */
  CHLTVFrame::CHLTVFrame(this_01);
                    /* try { // try from 0017359b to 00173608 has its CatchHandler @ 001737ee */
  CClientFrame::CopyFrame((CClientFrame *)this_01,param_1);
  CHLTVFrame::CopyHLTVData(this_01,(CHLTVFrame *)this_00);
  CClientFrameManager::AddClientFrame((CClientFrameManager *)(this + 0x1cc),(CClientFrame *)this_01)
  ;
  cVar3 = (**(code **)(*(int *)this + 0x54))(this);
  if (cVar3 != '\0') {
                    /* try { // try from 00173731 to 001737bb has its CatchHandler @ 001737ee */
    cVar3 = CHLTVDemoRecorder::IsRecording((CHLTVDemoRecorder *)(this + 0x4c04));
    if (cVar3 != '\0') {
      CHLTVDemoRecorder::WriteFrame((CHLTVDemoRecorder *)(this + 0x4c04),(CHLTVFrame *)this_00);
    }
  }
  iVar6 = 0;
  do {
    bf_write::Reset((bf_write *)(this + iVar6 + 0x52ec));
    iVar6 = iVar6 + 0x18;
  } while (iVar6 != 0x90);
  CClientFrame::SetSnapshot(this_00,(CFrameSnapshot *)0x0);
  iVar6 = _DAT_0040b9d4;
  if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
    iVar4 = ThreadGetCurrentId();
    if (iVar6 == iVar4) {
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
      }
      DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
    }
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return this_01;
}

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)