L L4D2node

CGameServer::SendClientMessages

0x001ff900 · 1135 bytes · __thiscall

_ZN11CGameServer18SendClientMessagesEb

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameServer::SendClientMessages(bool) */

void __thiscall CGameServer::SendClientMessages(CGameServer *this,bool param_1)

{
  uint *puVar1;
  CGameClient *pCVar2;
  char cVar3;
  int iVar4;
  CFrameSnapshot *this_00;
  netadr_s *pnVar5;
  int iVar6;
  uint local_d4;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c0;
  undefined4 local_bc;
  int local_b8;
  code *local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  char *local_a0;
  CGameClient *local_9c [35];
  
  local_cc = 0;
  local_c8 = 0;
  if (_Plat_SetBenchmarkMode == 0) {
    local_b8 = 0;
  }
  else {
    (**(code **)(_Plat_SetBenchmarkMode + 0x50))
              (_Plat_SetBenchmarkMode,&local_cc,0,0,0,0,"/data/src/engine/./sv_main.cpp",0x7ff,
               &SendClientMessages(bool)::tm_fmt,"(%s)%s","Networking","SendClientMessages");
    local_b8 = _Plat_SetBenchmarkMode;
  }
  iVar6 = _DAT_0040b9d4;
  local_c0 = local_cc;
  local_bc = local_c8;
  if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
                    /* try { // try from 001ffa6e to 001fface has its CatchHandler @ 001ffd9e */
    iVar4 = ThreadGetCurrentId();
    if (iVar6 == iVar4) {
      if ((char *)*_DAT_0040b030 != "SendClientMessages") {
        _DAT_0040b030 =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a8175,(char *)0x0,0x2a6193);
      }
      puVar1 = (uint *)(_DAT_0040b0bc + 4 + _DAT_0040b030[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0040b02c = '\0';
    }
  }
                    /* try { // try from 001ff9dc to 001ffa5e has its CatchHandler @ 001ffdb6 */
  cVar3 = ShouldSyncClientUpdates();
  if (cVar3 != '\0') {
    SyncClientUpdates(this);
  }
  local_d4 = 0;
  iVar6 = 0;
  do {
    iVar4 = (**(code **)(*(int *)this + 0x20))(this);
    if (iVar4 <= iVar6) {
      if (local_d4 != 0) {
        this_00 = (CFrameSnapshot *)
                  CFrameSnapshotManager::TakeTickSnapshot
                            ((CFrameSnapshotManager *)framesnapshotmanager,*(int *)(this + 0xc));
        CopyTempEntities(this,this_00);
        SV_ComputeClientPacks(local_d4,local_9c,this_00);
        if ((local_d4 == 1) || (*(int *)(sv_parallel_sendsnapshot._28_4_ + 0x30) == 0)) {
          iVar6 = 0;
          do {
            pCVar2 = local_9c[iVar6];
            iVar4 = CGameClient::GetSendFrame(pCVar2);
            if (iVar4 != 0) {
              (**(code **)(*(int *)pCVar2 + 0xe4))(pCVar2,iVar4);
              (**(code **)(*(int *)pCVar2 + 0xd0))(pCVar2);
            }
            iVar6 = iVar6 + 1;
          } while (iVar6 < (int)local_d4);
          CFrameSnapshot::ReleaseReference(this_00);
        }
        else {
          local_a4 = 0;
          LOCK();
          local_a8 = 0;
          UNLOCK();
          local_a0 = "SV_ParallelSendSnapshot";
          local_b4 = SV_ParallelSendSnapshot;
          local_b0 = 0;
          local_ac = 0;
          CParallelProcessor<CGameClient*,CFuncJobItemProcessor<CGameClient*>,1>::Run
                    ((CParallelProcessor<CGameClient*,CFuncJobItemProcessor<CGameClient*>,1> *)
                     &local_b4,local_9c,local_d4,0x7fffffff,(IThreadPool *)0x0);
          CFrameSnapshot::ReleaseReference(this_00);
        }
      }
      (**(code **)(*serverGameClients + 0x28))(serverGameClients);
      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_b8 != 0) {
        (**(code **)(local_b8 + 0x54))(local_b8,local_c0,local_bc,0,0,0);
      }
      return;
    }
    pCVar2 = *(CGameClient **)(*(int *)(this + 0x114) + iVar6 * 4);
    cVar3 = (**(code **)(*(int *)pCVar2 + 0xcc))(pCVar2);
    if (cVar3 == '\0') {
      cVar3 = (**(code **)(*(int *)pCVar2 + 0x94))(pCVar2);
      if (cVar3 != '\0') {
        CGameClient::WriteViewAngleUpdate(pCVar2);
      }
    }
    else {
      if (param_1) {
                    /* try { // try from 001ffae5 to 001ffc0e has its CatchHandler @ 001ffdb6 */
        cVar3 = (**(code **)(*(int *)pCVar2 + 0x74))(pCVar2);
        if (cVar3 != '\0') {
          local_9c[local_d4] = pCVar2;
          local_d4 = local_d4 + 1;
          goto LAB_001ffa1d;
        }
      }
      cVar3 = (**(code **)(*(int *)pCVar2 + 0x78))(pCVar2);
      if (cVar3 == '\0') {
        cVar3 = NET_IsMultiplayer();
        if (cVar3 != '\0') {
                    /* try { // try from 001ffcc3 to 001ffd98 has its CatchHandler @ 001ffdb6 */
          iVar4 = (**(code **)(**(int **)(pCVar2 + 0xe8) + 0x44))(*(int **)(pCVar2 + 0xe8),1);
          if (iVar4 == 0) {
            pnVar5 = (netadr_s *)
                     (**(code **)(**(int **)(pCVar2 + 0xe8) + 200))(*(int **)(pCVar2 + 0xe8));
            NET_OutOfBandPrintf(*(int *)(this + 8),pnVar5,"%c00000000000000",0x42);
          }
        }
        (**(code **)(**(int **)(pCVar2 + 0xe8) + 0xc4))(*(int **)(pCVar2 + 0xe8),0);
        (**(code **)(*(int *)pCVar2 + 0xd0))(pCVar2);
      }
    }
LAB_001ffa1d:
    iVar6 = iVar6 + 1;
  } while( true );
}

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)