CAchievementMgr::SaveGlobalState
0x003e8d50 · 749 bytes · __thiscall
_ZN15CAchievementMgr15SaveGlobalStateEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CAchievementMgr::SaveGlobalState() */
void __thiscall CAchievementMgr::SaveGlobalState(CAchievementMgr *this)
{
uint *puVar1;
char cVar2;
undefined4 *puVar3;
int *piVar4;
int iVar5;
int iVar6;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_towlower == 0) {
local_20 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_34,0,0,0,0,
"/data/src/game/server/../../game/shared/achievementmgr.cpp",700,
&SaveGlobalState()::tm_fmt,"(%s)%s","Achievements","CAchievementMgr::SaveGlobalState"
);
local_20 = _towlower;
}
iVar6 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 003e8efe to 003e8f5e has its CatchHandler @ 003e904c */
iVar5 = ThreadGetCurrentId();
if (iVar6 == iVar5) {
if ((char *)*_DAT_0105d15c != "CAchievementMgr::SaveGlobalState") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfb284,(char *)0x0,0xbfafd6);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
/* try { // try from 003e8e0d to 003e8e8b has its CatchHandler @ 003e9061 */
puVar3 = (undefined4 *)(**(code **)(*g_pMatchFramework + 0x2c))(g_pMatchFramework);
piVar4 = (int *)(**(code **)*puVar3)(puVar3);
iVar5 = (**(code **)(*piVar4 + 4))(piVar4,0);
iVar6 = _DAT_0105db00;
if (iVar5 == 0) {
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar5 = ThreadGetCurrentId();
if (iVar6 == iVar5) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
else {
if (0 < *(int *)(this + 0x7c)) {
iVar6 = 0;
do {
piVar4 = *(int **)(*(int *)(this + 0x70) + iVar6 * 4);
if (piVar4 != (int *)0x0) {
(**(code **)(*piVar4 + 0x9c))(piVar4,iVar5);
}
iVar6 = iVar6 + 1;
} while (iVar6 < *(int *)(this + 0x7c));
}
if (0 < *(int *)(this + 0xa4)) {
iVar6 = 0;
do {
piVar4 = *(int **)(*(int *)(this + 0x98) + iVar6 * 4);
if (piVar4 != (int *)0x0) {
(**(code **)(*piVar4 + 0x9c))(piVar4,iVar5);
}
iVar6 = iVar6 + 1;
} while (iVar6 < *(int *)(this + 0xa4));
}
this[0x2ac] = (CAchievementMgr)0x0;
iVar6 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar5 = ThreadGetCurrentId();
if (iVar6 == iVar5) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
return;
}
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.