L L4D2node

CGameEventManager::AddListenerAll

0x00164c30 · 613 bytes · __thiscall

_ZN17CGameEventManager14AddListenerAllEPvi

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::AddListenerAll(void*, int) */

undefined4 __thiscall
CGameEventManager::AddListenerAll(CGameEventManager *this,void *param_1,int param_2)

{
  CGameEventManager *pCVar1;
  uint uVar2;
  uint uVar3;
  undefined4 uVar4;
  int iVar5;
  
  pCVar1 = this + 0x9c;
  if (_SetSeed != 0) {
    if (CTelemetryLock::CTelemetryLock(void*,char_const*)::s_bNameSet == '\0') {
      (**(code **)(_SetSeed + 0x5c))
                (_SetSeed,pCVar1,&CTelemetryLock::CTelemetryLock(void*,char_const*)::tm_fmt,
                 "CGameEventManager");
      CTelemetryLock::CTelemetryLock(void*,char_const*)::s_bNameSet = '\x01';
      if (_SetSeed == 0) goto LAB_00164cee;
    }
    (**(code **)(_SetSeed + 0x60))
              (_SetSeed,0,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3eb,pCVar1,
               &CTelemetryLock::CTelemetryLock(void*,char_const*)::tm_fmt,&DAT_002c48a3,
               "CGameEventManager");
  }
LAB_00164cee:
                    /* try { // try from 00164cee to 00164cf2 has its CatchHandler @ 00164ede */
  uVar3 = ThreadGetCurrentId();
  if (uVar3 != *(uint *)(this + 0x9c)) {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar3;
    }
    UNLOCK();
    if (uVar2 != 0) {
                    /* try { // try from 00164e8c to 00164e90 has its CatchHandler @ 00164ede */
      CThreadFastMutex::Lock((uint)pCVar1,uVar3);
      goto LAB_00164d1d;
    }
  }
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_00164d1d:
                    /* try { // try from 00164d64 to 00164df7 has its CatchHandler @ 00164e9d */
  if ((_SetSeed != 0) &&
     ((**(code **)(_SetSeed + 100))
                (_SetSeed,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3f3,
                 &CTelemetryLock::Locked()::tm_fmt,pCVar1,0), _SetSeed != 0)) {
    (**(code **)(_SetSeed + 0x6c))
              (_SetSeed,pCVar1,2,"/data/src/public/tier0/vprof_telemetry.h",0x3f4,
               &CTelemetryLock::Locked()::tm_fmt,"%s Locked","CGameEventManager");
  }
  if (param_1 == (void *)0x0) {
    uVar4 = 0;
  }
  else {
    iVar5 = 0;
    if (0 < *(int *)(this + 0x10)) {
      do {
        AddListener(this,param_1,(CGameEventDescriptor *)(iVar5 * 0x34 + *(int *)(this + 4)),param_2
                   );
        iVar5 = iVar5 + 1;
      } while (iVar5 < *(int *)(this + 0x10));
    }
    DevMsg(
          "Warning! Game event listener registerd for all events. Use newer game event interface.\n"
          );
    uVar4 = 1;
  }
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
  if (*(int *)(this + 0xa0) == 0) {
    LOCK();
    *(uint *)pCVar1 = 0;
    UNLOCK();
  }
  if ((pCVar1 != (CGameEventManager *)0x0) && (_SetSeed != 0)) {
    (**(code **)(_SetSeed + 0x6c))
              (_SetSeed,pCVar1,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
               &CTelemetryLock::Unlocked()::tm_fmt,"%s Released","CGameEventManager");
  }
  return uVar4;
}

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)