CL4DGameStats::AddMapStats
0x008e0620 · 429 bytes · __thiscall
_ZN13CL4DGameStats11AddMapStatsEv
Decompiled
undefined (1 param)
/* CL4DGameStats::AddMapStats() */
void __thiscall CL4DGameStats::AddMapStats(CL4DGameStats *this)
{
KeyValues *this_00;
int iVar1;
uint uVar2;
char *pcVar3;
undefined4 uVar4;
uint in_stack_ffffffa8;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffa8);
/* try { // try from 008e0655 to 008e0659 has its CatchHandler @ 008e07e2 */
KeyValues::KeyValues(this_00,"L4D2MapData",(IKeyValuesSystem *)0x0,false);
KeyValues::SetInt(this_00,"TotalTime",*(int *)(this + 0x78));
iVar1 = GetDifficulty();
KeyValues::SetInt(this_00,"Difficulty",iVar1);
uVar2 = IsInCommentaryMode();
*(uint *)(this + 0x3d8) = uVar2 & 0xff;
if (TheDirector == 0) {
uVar4 = 0;
}
else {
uVar4 = *(undefined4 *)(TheDirector + 0x3ec);
}
*(undefined4 *)(this + 0x3d0) = uVar4;
local_30 = 0;
local_2c = 0;
local_28 = 0;
*(undefined4 *)(this + 0x3b4) = *(undefined4 *)(this + 0x428);
local_24 = 0;
local_20 = 0;
local_40 = 2;
*(undefined4 *)(this + 0x3ec) = *(undefined4 *)(this + 0x42c);
local_3c = 2;
local_38 = 3;
local_34 = 9;
/* try { // try from 008e070e to 008e079d has its CatchHandler @ 008e07cd */
ForEachTerrorPlayer<PlayerCollector>((PlayerCollector *)&local_40);
iVar1 = 0;
*(undefined4 *)(this + 1000) = local_24;
do {
KeyValues::SetInt(this_00,(&L4D_STATS::MapDataTitle)[iVar1],*(int *)(this + iVar1 * 4 + 0x3b0));
iVar1 = iVar1 + 1;
} while (iVar1 != 0x12);
pcVar3 = "";
if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
pcVar3 = *(char **)(gpGlobals + 0x3c);
}
KeyValues::SetString(this_00,"MapID",pcVar3);
iVar1 = CSteamWorksGameStatsUploader::GetTimeSinceEpoch();
KeyValues::SetInt(this_00,"TimeSubmitted",iVar1);
CSteamWorksGameStatsUploader::AddStatsForUpload(steamGameStats,this_00);
local_24 = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_30);
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.