DownloadManager::Reset
0x0013d8e0 · 380 bytes · __thiscall
_ZN15DownloadManager5ResetEv
Decompiled
undefined (1 param)
/* DownloadManager::Reset() */
void __thiscall DownloadManager::Reset(DownloadManager *this)
{
undefined4 *puVar1;
DownloadCache *pDVar2;
char cVar3;
RequestContext *pRVar4;
int iVar5;
int iVar6;
if (*(int *)(this + 0x14) != 0) {
cVar3 = LoggingSystem_IsChannelEnabled(LOG_DownloadManager,0);
if (cVar3 == '\0') {
pRVar4 = *(RequestContext **)(this + 0x14);
iVar5 = *(int *)(pRVar4 + 0x514);
}
else {
LoggingSystem_Log(LOG_DownloadManager,0,DownloadColor,"Aborting download of %s\n",
*(int *)(this + 0x14) + 0x214);
pRVar4 = *(RequestContext **)(this + 0x14);
iVar5 = *(int *)(pRVar4 + 0x514);
}
if ((iVar5 != 0) && (*(int *)(pRVar4 + 0x518) != 0)) {
DownloadCache::PersistToCache(TheDownloadCache,pRVar4);
pRVar4 = *(RequestContext **)(this + 0x14);
}
*pRVar4 = (RequestContext)0x1;
CUtlVector<RequestContext*,CUtlMemory<RequestContext*,int>>::InsertBefore
((CUtlVector<RequestContext*,CUtlMemory<RequestContext*,int>> *)(this + 0x18),
*(int *)(this + 0x24),(RequestContext **)(this + 0x14));
*(undefined4 *)(this + 0x14) = 0;
}
iVar5 = 0;
iVar6 = 0;
if (0 < *(int *)(this + 0xc)) {
do {
cVar3 = LoggingSystem_IsChannelEnabled(LOG_DownloadManager,0);
if (cVar3 != '\0') {
LoggingSystem_Log(LOG_DownloadManager,0,DownloadColor,"Discarding queued download of %s\n",
*(int *)(*(int *)this + iVar5) + 0x214);
}
iVar6 = iVar6 + 1;
puVar1 = (undefined4 *)(*(int *)this + iVar5);
iVar5 = iVar5 + 4;
operator_delete((void *)*puVar1);
} while (iVar6 < *(int *)(this + 0xc));
}
pDVar2 = TheDownloadCache;
*(undefined4 *)(this + 0xc) = 0;
if (pDVar2 != (DownloadCache *)0x0) {
operator_delete(pDVar2);
TheDownloadCache = (DownloadCache *)0x0;
}
*(undefined4 *)(this + 0x2c) = 0;
*(undefined4 *)(this + 0x30) = 0;
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.