CUGCFileRequestManager::CreateFileDownloadRequest
0x002237d0 · 526 bytes · __cdecl
_ZN22CUGCFileRequestManager25CreateFileDownloadRequestEyPKcS1_jjb
Decompiled
undefined (6 params)
/* CUGCFileRequestManager::CreateFileDownloadRequest(unsigned long long, char const*, char const*,
unsigned int, unsigned int, bool) */
undefined4
CUGCFileRequestManager::CreateFileDownloadRequest
(ulonglong param_1,char *param_2,char *param_3,uint param_4,uint param_5,bool param_6)
{
char cVar1;
short sVar2;
UGCFileRequest_t *pUVar3;
bool bVar4;
undefined3 in_stack_0000001d;
UGCFileRequest_t in_stack_00000020;
UGCFileRequest_t *local_2c;
uint local_28;
char *local_24;
UGCFileRequest_t *local_20;
if ((param_1._4_4_ & (uint)param_2) == 0xffffffff) {
return 0;
}
local_28 = param_1._4_4_;
local_24 = param_2;
sVar2 = CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1,(Node_t *)&local_28);
if (sVar2 != -1) {
return 1;
}
pUVar3 = operator_new(0x8cc);
*(uint *)pUVar3 = 0xffffffff;
*(uint *)(pUVar3 + 4) = 0xffffffff;
*(uint *)(pUVar3 + 0x314) = 0xffffffff;
*(uint *)(pUVar3 + 0x318) = 0;
pUVar3[0x31c] = (UGCFileRequest_t)0x0;
*(uint *)(pUVar3 + 800) = 0;
*(uint *)(pUVar3 + 0x324) = 0;
/* try { // try from 00223874 to 00223878 has its CatchHandler @ 002239eb */
CUGCFileRequest::CUGCFileRequest((CUGCFileRequest *)(pUVar3 + 0x328));
pUVar3[0x10c] = (UGCFileRequest_t)0x0;
pUVar3[0x210] = (UGCFileRequest_t)0x0;
pUVar3[8] = (UGCFileRequest_t)0x0;
*(char **)(pUVar3 + 4) = param_2;
*(uint *)(pUVar3 + 0x314) = 0;
*(uint *)pUVar3 = param_1._4_4_;
local_2c = pUVar3;
if (param_3 != (char *)0x0) {
V_strncpy((char *)(pUVar3 + 0x210),param_3,0x104);
V_FixSlashes((char *)(local_2c + 0x210),'/');
}
if (param_4 != 0) {
V_strncpy((char *)(local_2c + 0x10c),(char *)param_4,0x104);
}
local_2c[0x31c] = in_stack_00000020;
*(uint *)(local_2c + 0x318) = _param_6;
*(uint *)(local_2c + 0x324) = g_TimeStampIncr;
bVar4 = 0xfffffffe < g_TimeStampIncr;
g_TimeStampIncr = g_TimeStampIncr + 1;
DAT_003ef494 = DAT_003ef494 + (uint)bVar4;
*(uint *)(local_2c + 800) = param_5;
CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
::Insert((CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
*)((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1 + 0x1c),&local_2c);
cVar1 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
if (cVar1 != '\0') {
LoggingSystem_Log(LOG_WORKSHOP,0,
"[CUGCFileRequestManager] Inserted Download: %llu\tPriority:%u\tTimestamp:%u\n"
,*(uint *)local_2c,*(uint *)(local_2c + 4),*(uint *)(local_2c + 800),
*(uint *)(local_2c + 0x324));
}
local_24 = param_2;
local_28 = param_1._4_4_;
local_20 = local_2c;
CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert((CUtlRBTree<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,UGCFileRequest_t_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)param_1,(Node_t *)&local_28);
return 1;
}
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.