CL4DGameStats::AddAchievementStats
0x008dfd80 · 218 bytes · __thiscall
_ZN13CL4DGameStats19AddAchievementStatsEv
Decompiled
undefined (1 param)
/* CL4DGameStats::AddAchievementStats() */
void __thiscall CL4DGameStats::AddAchievementStats(CL4DGameStats *this)
{
char *pcVar1;
int iVar2;
int iVar3;
KeyValues *in_stack_ffffffd8;
if (0 < *(int *)(this + 0x404)) {
iVar3 = 0;
do {
in_stack_ffffffd8 = KeyValues::operator_new((KeyValues *)0x2c,(uint)in_stack_ffffffd8);
/* try { // try from 008dfdc9 to 008dfdcd has its CatchHandler @ 008dfe5a */
KeyValues::KeyValues(in_stack_ffffffd8,"AchievementData",(IKeyValuesSystem *)0x0,false);
KeyValues::SetInt(in_stack_ffffffd8,"AchievementID",
*(int *)(*(int *)(this + 0x3f8) + iVar3 * 4));
pcVar1 = *(char **)(gpGlobals + 0x3c);
if (pcVar1 == (char *)0x0) {
pcVar1 = "";
}
iVar3 = iVar3 + 1;
KeyValues::SetString(in_stack_ffffffd8,"MapID",pcVar1);
iVar2 = CSteamWorksGameStatsUploader::GetTimeSinceEpoch();
KeyValues::SetInt(in_stack_ffffffd8,"TimeSubmitted",iVar2);
CSteamWorksGameStatsUploader::AddStatsForUpload(steamGameStats,in_stack_ffffffd8);
} while (iVar3 < *(int *)(this + 0x404));
}
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.