CGameEventManager::RemoveListenerOld
0x001644b0 · 828 bytes · __thiscall
_ZN17CGameEventManager17RemoveListenerOldEPv
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::RemoveListenerOld(void*) */
uint __thiscall CGameEventManager::RemoveListenerOld(CGameEventManager *this,void *param_1)
{
CGameEventManager *pCVar1;
uint uVar2;
uint uVar3;
int iVar4;
int iVar5;
CGameEventCallback **local_30;
CGameEventCallback *local_28;
CGameEventManager *local_24;
char *local_20;
local_20 = "CGameEventManager";
pCVar1 = this + 0x9c;
local_24 = pCVar1;
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_0016456e;
}
(**(code **)(_SetSeed + 0x60))
(_SetSeed,0,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3eb,local_24,
&CTelemetryLock::CTelemetryLock(void*,char_const*)::tm_fmt,&DAT_002c48a3,local_20);
}
LAB_0016456e:
/* try { // try from 0016456e to 00164572 has its CatchHandler @ 001647f9 */
uVar3 = ThreadGetCurrentId();
if (uVar3 != *(uint *)(this + 0x9c)) {
LOCK();
uVar2 = *(uint *)pCVar1;
if (uVar2 == 0) {
*(uint *)pCVar1 = uVar3;
}
UNLOCK();
if (uVar2 != 0) {
/* try { // try from 001646f4 to 001646f8 has its CatchHandler @ 001647f9 */
CThreadFastMutex::Lock((uint)pCVar1,uVar3);
goto LAB_0016459d;
}
}
*(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_0016459d:
/* try { // try from 001645e4 to 0016466c has its CatchHandler @ 0016480e */
if ((_SetSeed != 0) &&
((**(code **)(_SetSeed + 100))
(_SetSeed,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3f3,
&CTelemetryLock::Locked()::tm_fmt,local_24,0), _SetSeed != 0)) {
(**(code **)(_SetSeed + 0x6c))
(_SetSeed,local_24,2,"/data/src/public/tier0/vprof_telemetry.h",0x3f4,
&CTelemetryLock::Locked()::tm_fmt,"%s Locked",local_20);
}
if (*(int *)(this + 0x24) < 1) {
LAB_0016465a:
local_28 = (CGameEventCallback *)0x0;
DevMsg("RemoveListenerOld: couldn\'t find listener\n");
*(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
uVar3 = *(uint *)(this + 0xa0);
if (uVar3 == 0) {
LOCK();
uVar3 = *(uint *)pCVar1;
*(uint *)pCVar1 = 0;
UNLOCK();
}
if ((local_24 != (CGameEventManager *)0x0) && (uVar3 = 0, _SetSeed != 0)) {
uVar3 = (**(code **)(_SetSeed + 0x6c))
(_SetSeed,local_24,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
&CTelemetryLock::Unlocked()::tm_fmt,"%s Released",local_20);
}
}
else {
local_28 = (CGameEventCallback *)**(undefined4 **)(this + 0x18);
if (param_1 != *(void **)local_28) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == *(int *)(this + 0x24)) goto LAB_0016465a;
local_28 = (CGameEventCallback *)(*(undefined4 **)(this + 0x18))[iVar4];
} while (param_1 != *(void **)local_28);
}
if (0 < *(int *)(this + 0x10)) {
iVar4 = 0;
iVar5 = 0;
do {
/* try { // try from 00164732 to 00164753 has its CatchHandler @ 0016480e */
CUtlVector<CGameEventCallback*,CUtlMemory<CGameEventCallback*,int>>::FindAndRemove
((CUtlVector<CGameEventCallback*,CUtlMemory<CGameEventCallback*,int>> *)
(*(int *)(this + 4) + iVar5 + 0xc),&local_28);
iVar4 = iVar4 + 1;
iVar5 = iVar5 + 0x34;
} while (iVar4 < *(int *)(this + 0x10));
}
local_30 = &local_28;
CUtlVector<CGameEventCallback*,CUtlMemory<CGameEventCallback*,int>>::FindAndRemove
((CUtlVector<CGameEventCallback*,CUtlMemory<CGameEventCallback*,int>> *)(this + 0x18),
local_30);
if (*(int *)(local_28 + 4) == 4) {
this[0xa4] = (CGameEventManager)0x1;
}
operator_delete(local_28);
*(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
uVar3 = *(uint *)(this + 0xa0);
if (uVar3 == 0) {
LOCK();
uVar3 = *(uint *)pCVar1;
*(uint *)pCVar1 = 0;
UNLOCK();
}
if ((local_24 != (CGameEventManager *)0x0) && (uVar3 = 0, _SetSeed != 0)) {
uVar3 = (**(code **)(_SetSeed + 0x6c))
(_SetSeed,local_24,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
&CTelemetryLock::Unlocked()::tm_fmt,"%s Released",local_20);
}
}
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.