COM_SetupLogDir
0x00126e20 · 485 bytes · __cdecl
_Z15COM_SetupLogDirPKc
Decompiled
undefined (1 param)
/* COM_SetupLogDir(char const*) */
void COM_SetupLogDir(char *param_1)
{
char cVar1;
int *piVar2;
int iVar3;
int in_GS_OFFSET;
char local_32c [260];
char local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(local_32c,com_gamedir,0x104);
(**(code **)(*g_pFileSystem + 0x20))(g_pFileSystem,0,"LOGDIR");
if (param_1 != (char *)0x0) {
piVar2 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar2 + 0x28))(piVar2,"-uselogdir");
if (iVar3 != 0) {
iVar3 = 0;
do {
V_snprintf(local_228,0x104,"logs/%s/%04i",param_1,iVar3);
cVar1 = (**(code **)(*g_pFileSystem + 0x4c))(g_pFileSystem,local_228,&DAT_002a076d);
if (cVar1 == '\0') goto LAB_00126ef4;
iVar3 = iVar3 + 1;
} while (iVar3 != 10000);
V_snprintf(local_228,0x104,"logs/%s/%04i",param_1,0);
LAB_00126ef4:
(**(code **)(*g_pFileSystem + 0x48))(g_pFileSystem,local_228,&DAT_002a076d);
if (COM_SetupLogDir(char_const*)::pathsetup == '\0') {
COM_SetupLogDir(char_const*)::pathsetup = '\x01';
V_snprintf(local_124,0x104,"%s/%s",local_32c,local_228);
(**(code **)(*g_pFileSystem + 0x1c))(g_pFileSystem,local_124,"LOGDIR",1,0);
}
goto LAB_00126faf;
}
}
(**(code **)(*g_pFileSystem + 0x1c))(g_pFileSystem,local_32c,"LOGDIR",1,0);
LAB_00126faf:
(**(code **)(*g_pFileSystem + 0x2c))(g_pFileSystem,"LOGDIR",1);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.