DownloadCache::PersistToCache
0x0013ce70 · 279 bytes · __thiscall
_ZN13DownloadCache14PersistToCacheEPK14RequestContext
Decompiled
undefined (2 params)
/* DownloadCache::PersistToCache(RequestContext const*) */
void __thiscall DownloadCache::PersistToCache(DownloadCache *this,RequestContext *param_1)
{
int iVar1;
IBaseFileSystem *pIVar2;
int in_GS_OFFSET;
char local_1020 [4096];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((((*(int *)this != 0) && (param_1 != (RequestContext *)0x0)) &&
(*(int *)(param_1 + 0x520) != 0)) &&
((*(int *)(param_1 + 0x514) != 0 && (*(int *)(param_1 + 0x518) != 0)))) {
GenerateCacheFilename(this,param_1,local_1020);
iVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,local_1020,&DAT_002a5c80,0);
if (iVar1 != 0) {
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))
(g_pFileSystem + 4,*(undefined4 *)(param_1 + 0x520),*(undefined4 *)(param_1 + 0x518)
,iVar1);
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar1);
pIVar2 = (IBaseFileSystem *)0x0;
if (g_pFileSystem != 0) {
pIVar2 = (IBaseFileSystem *)(g_pFileSystem + 4);
}
KeyValues::SaveToFile(*(KeyValues **)this,pIVar2,"cache/DownloadCache.db",(char *)0x0);
}
}
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.