CGameEventManager::Reset
0x001651b0 · 721 bytes · __thiscall
_ZN17CGameEventManager5ResetEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::Reset() */
uint __thiscall CGameEventManager::Reset(CGameEventManager *this)
{
CGameEventManager *pCVar1;
uint uVar2;
uint uVar3;
int iVar4;
int iVar5;
int iVar6;
int local_30;
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_0016526e;
}
(**(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_0016526e:
/* try { // try from 0016526e to 00165272 has its CatchHandler @ 001654cf */
uVar3 = ThreadGetCurrentId();
if (uVar3 != *(uint *)(this + 0x9c)) {
LOCK();
uVar2 = *(uint *)pCVar1;
if (uVar2 == 0) {
*(uint *)pCVar1 = uVar3;
}
UNLOCK();
if (uVar2 != 0) {
/* try { // try from 00165484 to 00165488 has its CatchHandler @ 001654cf */
CThreadFastMutex::Lock((uint)pCVar1,uVar3);
goto LAB_0016529d;
}
}
*(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_0016529d:
/* try { // try from 001652e4 to 001653e0 has its CatchHandler @ 0016548e */
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");
}
iVar5 = *(int *)(this + 0x10);
iVar6 = 0;
local_30 = 0;
if (0 < iVar5) {
do {
iVar4 = *(int *)(this + 4) + iVar6;
if (*(int *)(iVar4 + 8) != 0) {
KeyValues::deleteThis();
*(undefined4 *)(iVar4 + 8) = 0;
}
*(undefined4 *)(iVar4 + 0x18) = 0;
iVar6 = iVar6 + 0x34;
CUtlMemory<CGameEventCallback*,int>::Purge
((CUtlMemory<CGameEventCallback*,int> *)(iVar4 + 0xc));
local_30 = local_30 + 1;
*(undefined4 *)(iVar4 + 0x1c) = *(undefined4 *)(iVar4 + 0xc);
} while (local_30 != iVar5);
}
CUtlVector<CGameEventDescriptor,CUtlMemory<CGameEventDescriptor,int>>::RemoveAll
((CUtlVector<CGameEventDescriptor,CUtlMemory<CGameEventDescriptor,int>> *)(this + 4));
iVar5 = 0;
CUtlMemory<CGameEventDescriptor,int>::Purge((CUtlMemory<CGameEventDescriptor,int> *)(this + 4));
*(undefined4 *)(this + 0x14) = *(undefined4 *)(this + 4);
if (0 < *(int *)(this + 0x24)) {
do {
iVar6 = iVar5 * 4;
iVar5 = iVar5 + 1;
operator_delete(*(void **)(*(int *)(this + 0x18) + iVar6));
} while (iVar5 < *(int *)(this + 0x24));
}
*(undefined4 *)(this + 0x24) = 0;
CUtlMemory<CGameEventCallback*,int>::Purge((CUtlMemory<CGameEventCallback*,int> *)(this + 0x18));
*(undefined4 *)(this + 0x28) = *(undefined4 *)(this + 0x18);
CUtlSymbolTable::RemoveAll((CUtlSymbolTable *)(this + 0x2c));
*(undefined4 *)(this + 0x70) = 0;
CUtlDict<int,int>::RemoveAll((CUtlDict<int,int> *)(this + 0x78));
this[0xa4] = (CGameEventManager)0x1;
*(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 intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.