L L4D2node

CGameClient::SendSound

0x001ea0d0 · 906 bytes · __thiscall

_ZN11CGameClient9SendSoundER11SoundInfo_tb

Decompiled

undefined (3 params)

/* CGameClient::SendSound(SoundInfo_t&, bool) */

void __thiscall CGameClient::SendSound(CGameClient *this,SoundInfo_t *param_1,bool param_2)

{
  char cVar1;
  undefined4 uVar2;
  char *pcVar3;
  char *pcVar4;
  int in_GS_OFFSET;
  longdouble lVar5;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined1 local_d8;
  undefined1 local_d7;
  undefined1 local_d6;
  undefined **local_d4;
  undefined1 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined8 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined8 local_b0;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined1 local_a0;
  undefined8 local_9c;
  undefined4 local_94;
  undefined4 local_90;
  undefined1 local_88;
  undefined4 local_84;
  undefined4 local_7c;
  undefined1 local_78;
  undefined4 local_74;
  undefined4 local_70;
  bf_write local_58 [24];
  undefined1 local_40 [32];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  cVar1 = (**(code **)(*(int *)this + 0x78))(this);
  if ((((cVar1 == '\0') || (cVar1 = (**(code **)(*(int *)this + 0x7c))(this), cVar1 != '\0')) ||
      (cVar1 = (**(code **)(*(int *)this + 0x94))(this), cVar1 != '\0')) &&
     (this[0x1f8a8] == (CGameClient)0x0)) {
    if (param_2) {
      local_c8 = 0;
      local_c0 = 0;
      local_b0 = 0;
      local_9c = 0;
      local_c4 = 0;
      local_b8 = 0;
      local_b4 = 0;
      local_a8 = 0;
      local_a4 = 0;
      local_a0 = 0;
      local_94 = 0;
      local_90 = 0;
      local_d0 = 1;
      local_cc = 0;
      local_d4 = &PTR__SVC_Sounds_002a1dc8;
      local_78 = 0;
      local_7c = 0;
      local_74 = 0xffffffff;
      local_70 = 0;
      bf_write::bf_write(local_58);
      *(uint *)(this + 0x1d74c) = *(int *)(this + 0x1d74c) + 1U & 0x3ff;
      *(undefined4 *)(param_1 + 0x34) = 0;
      bf_write::StartWriting(local_58,local_40,0x20,0,-1);
      local_84 = 1;
      local_88 = 1;
      local_100 = 0;
      local_fc = 0;
      local_104 = 0x3f800000;
      local_dc = 0x4b;
      local_ec = 100;
      local_f4 = 0;
      local_e0 = 0xffffffff;
      local_f0 = 6;
      local_e4 = 0;
      local_e8 = 0;
      local_f8 = 0;
      local_108 = 0;
      local_d6 = 0;
      local_d8 = 0;
      local_d7 = 0;
      local_12c = 0;
      local_128 = 0;
      local_124 = 0;
      local_120 = 0;
      local_11c = 0;
      local_118 = 0;
      local_114 = 0;
      local_110 = 0;
      local_10c = 0;
      lVar5 = (longdouble)CBaseServer::GetFinalTickTime((CBaseServer *)&sv);
      SoundInfo_t::WriteDelta(param_1,(SoundInfo_t *)&local_12c,local_58,(float)lVar5);
      if (*(int *)(net_showreliablesounds._28_4_ + 0x30) != 0) {
        if (param_1[0x54] == (SoundInfo_t)0x0) {
          uVar2 = CGameServer::GetSound((CGameServer *)&sv,*(int *)(param_1 + 0x48));
        }
        else {
          uVar2 = VOX_SentenceNameFromIndex(*(int *)(param_1 + 0x48));
        }
        pcVar3 = "sentence";
        if (param_1[0x54] == (SoundInfo_t)0x0) {
          pcVar3 = "sound";
        }
        pcVar4 = " stop";
        if (((byte)param_1[0x44] & 4) == 0) {
          pcVar4 = "";
        }
        Warning("reliable%s %s %d/%d/%d/%s\n",pcVar4,pcVar3,*(undefined4 *)(param_1 + 0x38),
                *(undefined4 *)(param_1 + 0x3c),*(undefined4 *)(param_1 + 0x48),uVar2);
      }
      (**(code **)(*(int *)this + 100))(this,&local_d4,1,0);
    }
    else {
      *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(this + 0x1d74c);
      CUtlVector<SoundInfo_t,CUtlMemory<SoundInfo_t,int>>::InsertBefore
                ((CUtlVector<SoundInfo_t,CUtlMemory<SoundInfo_t,int>> *)(this + 0x1d754),
                 *(int *)(this + 0x1d760),param_1);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)