L L4D2node

CEngineSoundServer::EmitSound

0x001579c0 · 1003 bytes · __thiscall

_ZN18CEngineSoundServer9EmitSoundER16IRecipientFilteriiPKcf12soundlevel_tiiPK6VectorS7_P10CUtlVectorIS5_10CUtlMemoryIS5_iEEbfi

Decompiled

undefined (15 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CEngineSoundServer::EmitSound(IRecipientFilter&, int, int, char const*, float, soundlevel_t, int,
   int, Vector const*, Vector const*, CUtlVector<Vector, CUtlMemory<Vector, int> >*, bool, float,
   int) */

void __thiscall
CEngineSoundServer::EmitSound
          (CEngineSoundServer *this,undefined4 param_1,undefined4 param_2,undefined4 param_3,
          byte *param_4,undefined4 param_5,undefined4 param_7,undefined4 param_8,undefined4 param_9,
          undefined4 param_10,undefined4 param_11,undefined4 param_12,undefined1 param_13,
          undefined4 param_14,undefined4 param_15)

{
  byte bVar1;
  int iVar2;
  char cVar3;
  int iVar4;
  byte *pbVar5;
  int local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_exit == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_34,0,0,0,0,"/data/src/engine/./enginesoundserver.cpp",0x13a,
               &EmitSound(IRecipientFilter&,int,int,char_const*,float,soundlevel_t,int,int,Vector_const*,Vector_const*,CUtlVector<Vector,CUtlMemory<Vector,int>>*,bool,float,int)
                ::tm_fmt,"(%s)%s","Unaccounted","CEngineSoundServer::EmitSound");
    local_20 = _exit;
  }
  iVar2 = _DAT_0040b9d4;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 00157ba6 to 00157bf4 has its CatchHandler @ 00157dcb */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar2 == iVar4)) {
    if ((char *)*_DAT_0040b030 != "CEngineSoundServer::EmitSound") {
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2ae8ad,&DAT_00000001,0x2a054b);
    }
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
  pbVar5 = param_4;
  if (param_4 == (byte *)0x0) {
LAB_00157ad0:
                    /* try { // try from 00157b3f to 00157b43 has its CatchHandler @ 00157de0 */
    EmitSoundInternal(this,param_1,param_2,param_3,param_4,param_5,param_7,param_8,param_9,param_10,
                      param_11,param_12,param_13,param_14,param_15);
LAB_00157b44:
    iVar2 = _DAT_0040b9d4;
    if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
       (iVar4 = ThreadGetCurrentId(), iVar2 == 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;
  }
  do {
    bVar1 = *pbVar5;
    if ((bVar1 & 0xfd) == 0x21) {
LAB_00157c08:
      if (bVar1 == 0x21) {
        local_38 = -1;
        for (pbVar5 = param_4;
            ((bVar1 = *pbVar5, bVar1 == 0x21 || ((byte)(bVar1 - 0x23) < 2)) ||
            (((byte)(bVar1 - 0x28) < 3 ||
             (((((byte)(bVar1 - 0x3e) < 3 || (bVar1 == 0x3c)) || (bVar1 == 0x5e)) || (bVar1 == 0x7d)
              ))))); pbVar5 = pbVar5 + 1) {
        }
                    /* try { // try from 00157cd9 to 00157dad has its CatchHandler @ 00157de0 */
        VOX_LookupString(pbVar5,&local_38,0,0,0);
        if (local_38 < 0) {
          for (; ((bVar1 = *param_4, bVar1 == 0x21 || ((byte)(bVar1 - 0x23) < 2)) ||
                 (((((byte)(bVar1 - 0x28) < 3 || (((byte)(bVar1 - 0x3e) < 3 || (bVar1 == 0x3c)))) ||
                   (bVar1 == 0x5e)) || (bVar1 == 0x7d)))); param_4 = param_4 + 1) {
          }
          DevWarning(2,"Unable to find %s in sentences.txt\n",param_4);
        }
        else {
          (**(code **)(*(int *)this + 0x1c))
                    (this,param_1,param_2,param_3,local_38,param_5,param_7,param_8,param_9,param_10,
                     param_11,param_12,param_13,param_14,param_15);
        }
        goto LAB_00157b44;
      }
    }
    else if (2 < (byte)(bVar1 - 0x28)) {
      if (((byte)(bVar1 - 0x3e) < 3) || (bVar1 == 0x3c)) goto LAB_00157c08;
      if (((bVar1 != 0x5e) && (bVar1 != 0x7d)) && (bVar1 != 0x24)) goto LAB_00157ad0;
    }
    pbVar5 = pbVar5 + 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)