LoadGameInfoFile
0x000d8910 · 325 bytes · __cdecl
_Z16LoadGameInfoFilePKcRP9KeyValuesS3_S3_
Decompiled
undefined (4 params)
/* LoadGameInfoFile(char const*, KeyValues*&, KeyValues*&, KeyValues*&) */
undefined4
LoadGameInfoFile(char *param_1,KeyValues **param_2,KeyValues **param_3,KeyValues **param_4)
{
KeyValues *pKVar1;
undefined4 uVar2;
int in_GS_OFFSET;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(local_124,param_1,0x104);
V_AppendSlash(local_124,0x104);
V_strncat(local_124,"gameinfo.txt",0x104,-1);
V_FixSlashes(local_124,'/');
pKVar1 = (KeyValues *)ReadKeyValuesFile(local_124);
*param_2 = pKVar1;
if (pKVar1 == (KeyValues *)0x0) {
uVar2 = SetupFileSystemError(1,1,"%s is missing.",local_124);
}
else {
pKVar1 = (KeyValues *)KeyValues::FindKey(pKVar1,"FileSystem",false);
*param_3 = pKVar1;
if (pKVar1 != (KeyValues *)0x0) {
pKVar1 = (KeyValues *)KeyValues::FindKey(pKVar1,"SearchPaths",false);
*param_4 = pKVar1;
uVar2 = 0;
if (pKVar1 != (KeyValues *)0x0) goto LAB_000d89eb;
}
KeyValues::deleteThis();
uVar2 = SetupFileSystemError(1,2,"%s is not a valid format.",local_124);
}
LAB_000d89eb:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar2;
}
/* 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.