L L4D2node

CGameEventManager::CreateEvent

0x00160eb0 · 537 bytes · __thiscall

_ZN17CGameEventManager11CreateEventEP20CGameEventDescriptorPKc

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::CreateEvent(CGameEventDescriptor*, char const*) */

CGameEvent * __thiscall
CGameEventManager::CreateEvent(CGameEventManager *this,CGameEventDescriptor *param_1,char *param_2)

{
  CGameEventManager *pCVar1;
  uint uVar2;
  uint uVar3;
  CGameEvent *this_00;
  
  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_00160f65;
    }
    (**(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_00160f65:
                    /* try { // try from 00160f65 to 00160f69 has its CatchHandler @ 001610d3 */
  uVar3 = ThreadGetCurrentId();
  if (uVar3 != *(uint *)(this + 0x9c)) {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar3;
    }
    UNLOCK();
    if (uVar2 != 0) {
                    /* try { // try from 001610c9 to 001610cd has its CatchHandler @ 001610d3 */
      CThreadFastMutex::Lock((uint)pCVar1,uVar3);
      goto LAB_00160f91;
    }
  }
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_00160f91:
                    /* try { // try from 00160fd8 to 0016102b has its CatchHandler @ 00161123 */
  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");
  }
  this_00 = operator_new(0xc);
                    /* try { // try from 0016103f to 00161043 has its CatchHandler @ 001610e8 */
  CGameEvent::CGameEvent(this_00,param_1,param_2);
  *(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 this_00;
}

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)