L L4D2node

CGameEventManager::FreeEvent

0x00160670 · 627 bytes · __thiscall

_ZN17CGameEventManager9FreeEventEP10IGameEvent

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::FreeEvent(IGameEvent*) */

uint __thiscall CGameEventManager::FreeEvent(CGameEventManager *this,IGameEvent *param_1)

{
  CGameEventManager *pCVar1;
  uint uVar2;
  uint uVar3;
  
  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_0016072d;
    }
    (**(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_0016072d:
                    /* try { // try from 0016072d to 00160731 has its CatchHandler @ 00160904 */
  uVar3 = ThreadGetCurrentId();
  if (uVar3 != *(uint *)(this + 0x9c)) {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar3;
    }
    UNLOCK();
    if (uVar2 != 0) {
                    /* try { // try from 00160879 to 0016087d has its CatchHandler @ 00160904 */
      CThreadFastMutex::Lock((uint)pCVar1,uVar3);
      goto LAB_00160759;
    }
  }
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_00160759:
                    /* try { // try from 001607a0 to 001607e7 has its CatchHandler @ 00160919 */
  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 == (IGameEvent *)0x0) {
    *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
    uVar3 = *(uint *)(this + 0xa0);
    if (uVar3 == 0) {
      LOCK();
      *(uint *)pCVar1 = 0;
      UNLOCK();
    }
    if ((pCVar1 != (CGameEventManager *)0x0) && (uVar3 = 0, _SetSeed != 0)) {
      uVar3 = (**(code **)(_SetSeed + 0x6c))
                        (_SetSeed,pCVar1,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
                         &CTelemetryLock::Unlocked()::tm_fmt,"%s Released","CGameEventManager");
    }
  }
  else {
    (**(code **)(*(int *)param_1 + 4))(param_1);
    *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
    uVar3 = *(uint *)(this + 0xa0);
    if (uVar3 == 0) {
      LOCK();
      uVar3 = *(uint *)pCVar1;
      *(uint *)pCVar1 = 0;
      UNLOCK();
    }
    if ((pCVar1 != (CGameEventManager *)0x0) && (uVar3 = 0, _SetSeed != 0)) {
      uVar3 = (**(code **)(_SetSeed + 0x6c))
                        (_SetSeed,pCVar1,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
                         &CTelemetryLock::Unlocked()::tm_fmt,"%s Released","CGameEventManager");
    }
  }
  return uVar3;
}

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)