CDownloadListGenerator::OnLevelLoadStart
0x0013fdc0 · 499 bytes · __thiscall
_ZN22CDownloadListGenerator16OnLevelLoadStartEPKc
Decompiled
undefined (2 params)
/* CDownloadListGenerator::OnLevelLoadStart(char const*) */
void __thiscall CDownloadListGenerator::OnLevelLoadStart(CDownloadListGenerator *this,char *param_1)
{
char cVar1;
KeyValues *this_00;
IBaseFileSystem *pIVar2;
undefined4 uVar3;
int in_GS_OFFSET;
uint uVar4;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(this + 0x140) != 0) {
(**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,*(int *)(this + 0x140));
*(undefined4 *)(this + 0x140) = 0;
}
CUtlSymbolTable::RemoveAll((CUtlSymbolTable *)(this + 0x144));
if (*(int *)(sv_logdownloadlist._28_4_ + 0x30) != 0) {
(**(code **)(*g_pFileSystem + 0x48))(g_pFileSystem,"DownloadLists",&DAT_002a0772);
V_snprintf(local_124,0x104,"DownloadLists/%s.lst",param_1);
uVar3 = (**(code **)(g_pFileSystem[1] + 8))
(g_pFileSystem + 1,local_124,&DAT_002a5dab,&DAT_002a076d);
*(undefined4 *)(this + 0x140) = uVar3;
}
V_snprintf((char *)this,0x100,"%s/",com_gamedir);
V_FixSlashes((char *)this,'/');
this_00 = (KeyValues *)(this + 0x100);
uVar4 = 0x40;
V_snprintf((char *)this_00,0x40,"%s",param_1);
if (*(int *)(this + 0x18c) == 0) {
this_00 = KeyValues::operator_new((KeyValues *)0x2c,uVar4);
/* try { // try from 0013fec9 to 0013fecd has its CatchHandler @ 0013ffc5 */
KeyValues::KeyValues(this_00,"",(IKeyValuesSystem *)0x0,false);
pIVar2 = (IBaseFileSystem *)0x0;
if (g_pFileSystem != (int *)0x0) {
pIVar2 = (IBaseFileSystem *)(g_pFileSystem + 1);
}
cVar1 = KeyValues::LoadFromFile(this_00,pIVar2,"whitelist.cfg","MOD");
if ((cVar1 == '\0') || (cVar1 = LoadServerWhiteList(this,this_00), cVar1 == '\0')) {
DevWarning("Can\'t load pure server whitelist in %s.\n","whitelist.cfg");
}
KeyValues::deleteThis();
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail(this_00);
}
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.