L L4D2node

CGameEventManager::CreateEvent

0x00163860 · 654 bytes · __thiscall

_ZN17CGameEventManager11CreateEventEPKcbPi

Decompiled

undefined (4 params)

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

CGameEvent * __thiscall
CGameEventManager::CreateEvent(CGameEventManager *this,char *param_1,bool param_2,int *param_3)

{
  CGameEventManager *pCVar1;
  uint uVar2;
  uint uVar3;
  CGameEventDescriptor *pCVar4;
  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_0016391d;
    }
    (**(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_0016391d:
                    /* try { // try from 0016391d to 00163921 has its CatchHandler @ 00163b51 */
  uVar3 = ThreadGetCurrentId();
  if (uVar3 == *(uint *)(this + 0x9c)) {
LAB_0016393a:
    *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
  }
  else {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar3;
    }
    UNLOCK();
    if (uVar2 == 0) goto LAB_0016393a;
                    /* try { // try from 00163ad9 to 00163add has its CatchHandler @ 00163b51 */
    CThreadFastMutex::Lock((uint)pCVar1,uVar3);
  }
                    /* try { // try from 00163990 to 00163a25 has its CatchHandler @ 00163b02 */
  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 != (char *)0x0) && (*param_1 != '\0')) {
    pCVar4 = (CGameEventDescriptor *)GetEventDescriptor(this,param_1,param_3);
    if (pCVar4 == (CGameEventDescriptor *)0x0) {
                    /* try { // try from 00163af6 to 00163afa has its CatchHandler @ 00163b02 */
      DevMsg("CreateEvent: event \'%s\' not registered.\n",param_1);
      this_00 = (CGameEvent *)0x0;
      goto LAB_00163a3f;
    }
    if ((*(int *)(pCVar4 + 0x18) != 0) || (param_2)) {
      this_00 = operator_new(0xc);
                    /* try { // try from 00163a37 to 00163a3b has its CatchHandler @ 00163b42 */
      CGameEvent::CGameEvent(this_00,pCVar4,param_1);
      goto LAB_00163a3f;
    }
  }
  this_00 = (CGameEvent *)0x0;
LAB_00163a3f:
  *(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)