CBaseGameStats::StatsLog
0x00461b20 · 409 bytes · __thiscall
_ZN14CBaseGameStats8StatsLogEPKcz
Decompiled
undefined (2 params)
/* CBaseGameStats::StatsLog(char const*, ...) */
void __thiscall CBaseGameStats::StatsLog(CBaseGameStats *this,char *param_1,...)
{
CBaseGameStats CVar1;
tm *__tp;
char *pcVar2;
int in_GS_OFFSET;
time_t local_8a4;
char local_8a0 [128];
char local_820 [2048];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((((byte)this[0x54] & 1) != 0) || (((byte)this[0x54] & 2) != 0)) {
V_vsnprintf(local_820,0x800,param_1,&stack0x0000000c);
time(&local_8a4);
__tp = localtime(&local_8a4);
pcVar2 = asctime(__tp);
V_strncpy(local_8a0,pcVar2,0x80);
pcVar2 = strchr(local_8a0,10);
if (pcVar2 != (char *)0x0) {
*pcVar2 = '\0';
}
CVar1 = this[0x54];
if (((byte)CVar1 & 1) != 0) {
DevMsg("[GS %s - %7.2f] %s",local_8a0,(double)*gpGlobals,local_820);
CVar1 = this[0x54];
}
if ((((byte)CVar1 & 2) != 0) &&
((g_LogFileHandle != 0 ||
(g_LogFileHandle =
(**(code **)(filesystem[1] + 8))
(filesystem + 1,"gamestats.log",&DAT_00c908f8,&DAT_00c146f4),
g_LogFileHandle != 0)))) {
(**(code **)(*filesystem + 100))
(filesystem,g_LogFileHandle,"[GS %s - %7.2f] %s",local_8a0,(double)*gpGlobals,
local_820);
(**(code **)(filesystem[1] + 0x20))(filesystem + 1,g_LogFileHandle);
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.