CSteamWorksGameStatsUploader::AddStatsForUpload
0x004c68b0 · 409 bytes · __thiscall
_ZN28CSteamWorksGameStatsUploader17AddStatsForUploadEP9KeyValues
Decompiled
undefined (2 params)
/* CSteamWorksGameStatsUploader::AddStatsForUpload(KeyValues*) */
undefined4 __thiscall
CSteamWorksGameStatsUploader::AddStatsForUpload
(CSteamWorksGameStatsUploader *this,KeyValues *param_1)
{
int iVar1;
int iVar2;
int iVar3;
void *pvVar4;
int iVar5;
if (*(int *)(steamworks_stats_disable._28_4_ + 0x30) != 0) {
if (param_1 == (KeyValues *)0x0) {
return 3;
}
KeyValues::deleteThis();
return 3;
}
if (param_1 == (KeyValues *)0x0) {
return 2;
}
if (*(int *)(steamworks_immediate_upload._28_4_ + 0x30) != 0) {
ParseKeyValuesAndSendStats(this,param_1);
KeyValues::deleteThis();
return 1;
}
iVar1 = *(int *)(this + 0x394);
iVar3 = *(int *)(this + 0x38c);
iVar5 = iVar1 + 1;
if (iVar3 < iVar5) {
iVar2 = *(int *)(this + 0x390);
if (-1 < iVar2) {
if (iVar2 == 0) {
if (iVar3 == 0) {
if (iVar5 < 9) {
iVar3 = 8;
goto LAB_004c69af;
}
iVar3 = 8;
}
do {
iVar3 = iVar3 * 2;
} while (iVar3 < iVar5);
}
else {
for (iVar3 = (iVar1 / iVar2 + 1) * iVar2; iVar3 < iVar5; iVar3 = (iVar3 + iVar5) / 2) {
}
}
LAB_004c69af:
*(int *)(this + 0x38c) = iVar3;
if (*(void **)(this + 0x388) == (void *)0x0) {
pvVar4 = malloc(iVar3 << 2);
*(void **)(this + 0x388) = pvVar4;
}
else {
pvVar4 = realloc(*(void **)(this + 0x388),iVar3 << 2);
*(void **)(this + 0x388) = pvVar4;
iVar5 = *(int *)(this + 0x394) + 1;
}
goto LAB_004c6922;
}
}
pvVar4 = *(void **)(this + 0x388);
LAB_004c6922:
*(int *)(this + 0x394) = iVar5;
iVar5 = (iVar5 - iVar1) + -1;
*(void **)(this + 0x398) = pvVar4;
iVar1 = iVar1 * 4;
if (0 < iVar5) {
_V_memmove((void *)((int)pvVar4 + iVar1 + 4),(void *)((int)pvVar4 + iVar1),iVar5 * 4);
pvVar4 = *(void **)(this + 0x388);
}
if ((undefined4 *)((int)pvVar4 + iVar1) == (undefined4 *)0x0) {
return 1;
}
*(undefined4 *)((int)pvVar4 + iVar1) = param_1;
return 1;
}
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.