CAchievementMgr::ReadAchievementsFromTitleData
0x003e89f0 · 498 bytes · __thiscall
_ZN15CAchievementMgr29ReadAchievementsFromTitleDataEii
Decompiled
undefined (3 params)
/* CAchievementMgr::ReadAchievementsFromTitleData(int, int) */
void __thiscall
CAchievementMgr::ReadAchievementsFromTitleData(CAchievementMgr *this,int param_1,int param_2)
{
CAchievementMgr *pCVar1;
undefined4 *puVar2;
int *piVar3;
int iVar4;
int *piVar5;
KeyValues *this_00;
KeyValues *this_01;
uint uVar6;
char *pcVar7;
undefined4 uVar8;
undefined4 uVar9;
puVar2 = (undefined4 *)(**(code **)(*g_pMatchFramework + 0x2c))(g_pMatchFramework);
piVar3 = (int *)(**(code **)*puVar2)(puVar2);
piVar3 = (int *)(**(code **)(*piVar3 + 4))(piVar3,param_1);
if (piVar3 != (int *)0x0) {
this[0x2b9] = (CAchievementMgr)0x1;
iVar4 = (**(code **)(*piVar3 + 0x14))(piVar3,1);
if ((iVar4 != 0) && (*(char *)(iVar4 + 0x3c) == '\0')) {
puVar2 = (undefined4 *)(**(code **)(*g_pMatchFramework + 0x2c))(g_pMatchFramework);
piVar5 = (int *)(**(code **)*puVar2)(puVar2);
uVar6 = 0;
piVar5 = (int *)(**(code **)(*piVar5 + 4))(piVar5);
if (piVar5 != (int *)0x0) {
this_00 = KeyValues::operator_new((KeyValues *)0x2c,uVar6);
pcVar7 = "Leaderboard";
/* try { // try from 003e8b59 to 003e8b5d has its CatchHandler @ 003e8bef */
KeyValues::KeyValues(this_00,"Leaderboard",(IKeyValuesSystem *)0x0,false);
iVar4 = 0;
do {
/* try { // try from 003e8b67 to 003e8b6b has its CatchHandler @ 003e8c25 */
this_01 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar7);
/* try { // try from 003e8b8c to 003e8b90 has its CatchHandler @ 003e8c04 */
KeyValues::KeyValues
(this_01,(&ReadAchievementsFromTitleData(int,int)::szLegacyLeaderboards)[iVar4],
(IKeyValuesSystem *)0x0,false);
/* try { // try from 003e8b9b to 003e8bd9 has its CatchHandler @ 003e8c25 */
KeyValues::AddSubKey(this_00,this_01);
uVar8 = 0;
uVar9 = 0;
pcVar7 = "besttime";
KeyValues::SetUint64((char *)this_01,0xbfafb9);
iVar4 = iVar4 + 1;
} while (iVar4 != 0x13);
(**(code **)(*piVar5 + 0x1c))(piVar5,this_00,uVar8,uVar9);
if (this_00 != (KeyValues *)0x0) {
KeyValues::deleteThis();
}
}
}
iVar4 = 0;
pCVar1 = this + param_2 * 0x14 + 0x70;
if (0 < *(int *)(pCVar1 + 0xc)) {
do {
piVar5 = *(int **)(*(int *)pCVar1 + iVar4 * 4);
if (piVar5 != (int *)0x0) {
(**(code **)(*piVar5 + 0x98))(piVar5,piVar3);
}
iVar4 = iVar4 + 1;
} while (iVar4 < *(int *)(pCVar1 + 0xc));
}
pCVar1 = this + param_2 * 0x14 + 0x98;
if (0 < *(int *)(pCVar1 + 0xc)) {
iVar4 = 0;
do {
piVar5 = *(int **)(*(int *)pCVar1 + iVar4 * 4);
if (piVar5 != (int *)0x0) {
(**(code **)(*piVar5 + 0x98))(piVar5,piVar3);
}
iVar4 = iVar4 + 1;
} while (iVar4 < *(int *)(pCVar1 + 0xc));
}
this[0x2b9] = (CAchievementMgr)0x0;
/* WARNING: Could not recover jumptable at 0x003e8ae9. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 100))();
return;
}
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.