L L4D2node

CGameClient::FillSoundsMessage

0x001e95b0 · 567 bytes · __thiscall

_ZN11CGameClient17FillSoundsMessageER10SVC_Soundsi

Decompiled

undefined (3 params)

/* CGameClient::FillSoundsMessage(SVC_Sounds&, int) */

undefined4 __thiscall
CGameClient::FillSoundsMessage(CGameClient *this,SVC_Sounds *param_1,int param_2)

{
  SoundInfo_t *pSVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  longdouble lVar5;
  int local_80;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  
  local_80 = *(int *)(this + 0x1d760);
  if (param_2 < *(int *)(this + 0x1d760)) {
    local_80 = param_2;
  }
  if (local_80 == 0) {
    return 0;
  }
  local_48 = 0;
  local_44 = 0;
  local_4c = 0x3f800000;
  local_24 = 0x4b;
  *(int *)(param_1 + 0x50) = local_80;
  param_1[0x4c] = (SVC_Sounds)0x0;
  local_34 = 100;
  local_3c = 0;
  local_28 = 0xffffffff;
  local_38 = 6;
  local_2c = 0;
  local_30 = 0;
  local_40 = 0;
  local_50 = 0;
  local_1e = 0;
  local_20 = 0;
  local_1f = 0;
  local_74 = 0;
  local_70 = 0;
  local_6c = 0;
  local_68 = 0;
  local_64 = 0;
  local_60 = 0;
  local_5c = 0;
  local_58 = 0;
  local_54 = 0;
  (**(code **)(*(int *)param_1 + 0xc))(param_1,0);
  lVar5 = (longdouble)CBaseServer::GetFinalTickTime(*(CBaseServer **)(this + 0xb8));
  if (0 < local_80) {
    pSVar1 = (SoundInfo_t *)&local_74;
    iVar2 = 0;
    iVar3 = *(int *)(this + 0x1d754);
    do {
      iVar4 = iVar2 * 0x58;
      iVar2 = iVar2 + 1;
      SoundInfo_t::WriteDelta
                ((SoundInfo_t *)(iVar3 + iVar4),pSVar1,(bf_write *)(param_1 + 0x7c),(float)lVar5);
      iVar3 = *(int *)(this + 0x1d754);
      pSVar1 = (SoundInfo_t *)(iVar3 + iVar4);
    } while (iVar2 != local_80);
  }
  if (*(int *)(sv_sound_discardextraunreliable._28_4_ + 0x30) == 0) {
    iVar3 = *(int *)(this + 0x1d760) - (local_80 + param_2);
    if (0 < iVar3) {
      DevMsg(2,"Warning! Dropped %i unreliable sounds for client %s.\n",iVar3,this + 0x3c);
      local_80 = local_80 + iVar3;
    }
    if (0 < local_80) {
      iVar3 = *(int *)(this + 0x1d760) - local_80;
      if (0 < iVar3) {
        _V_memmove(*(void **)(this + 0x1d754),
                   (void *)(local_80 * 0x58 + (int)*(void **)(this + 0x1d754)),iVar3 * 0x58);
        iVar3 = *(int *)(this + 0x1d760) - local_80;
      }
      *(int *)(this + 0x1d760) = iVar3;
    }
  }
  else {
    if (*(int *)(this + 0x1d760) != local_80) {
      DevMsg(2,"Warning! Dropped %i unreliable sounds for client %s.\n",
             *(int *)(this + 0x1d760) - local_80,this + 0x3c);
    }
    *(undefined4 *)(this + 0x1d760) = 0;
  }
  return *(undefined4 *)(param_1 + 0x50);
}

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)