GCSDK::CJobMgr::CheckForJobTimeouts
0x00062900 · 523 bytes · __thiscall
_ZN5GCSDK7CJobMgr19CheckForJobTimeoutsER11CLimitTimer
Decompiled
undefined (2 params)
/* GCSDK::CJobMgr::CheckForJobTimeouts(CLimitTimer&) */
void __thiscall GCSDK::CJobMgr::CheckForJobTimeouts(CJobMgr *this,CLimitTimer *param_1)
{
CUtlRBTree<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*this_00;
undefined4 *puVar1;
CJob *this_01;
undefined8 uVar2;
ushort uVar3;
int iVar4;
uint uVar5;
int extraout_EDX;
int iVar6;
longlong lVar7;
undefined4 local_28;
undefined4 local_24;
this_00 = (CUtlRBTree<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x90);
iVar6 = 0;
do {
while( true ) {
if (*(int *)(this + 0x74) == -1) {
return;
}
iVar6 = iVar6 + 1;
if (iVar6 != 1) {
uVar2 = rdtsc();
uVar5 = (uint)((ulonglong)uVar2 >> 0x20);
if (*(uint *)(param_1 + 4) <= uVar5) {
if (*(uint *)(param_1 + 4) < uVar5) {
return;
}
if (*(uint *)param_1 <= (uint)uVar2) {
return;
}
}
}
puVar1 = (undefined4 *)(*(int *)(this + 0x68) + *(int *)(this + 0x74) * 0x24);
lVar7 = CJobTime::CServerMicroSecsPassed((CJobTime *)(puVar1 + 4));
if (lVar7 < 0) {
return;
}
if ((lVar7 < 0x100000000) && ((uint)lVar7 < 10000000)) {
return;
}
local_28 = *puVar1;
local_24 = puVar1[1];
iVar4 = CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
::Find((CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
*)this,(Node_t *)&local_28);
if (iVar4 != -1) break;
LAB_000629d4:
local_28 = *puVar1;
local_24 = puVar1[1];
CUtlRBTree<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Remove(this_00,(Node_t *)&local_28);
iVar4 = *(int *)(this + 0x74);
CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
::Unlink((CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
*)(this + 0x68),iVar4);
*(undefined4 *)(*(int *)(this + 0x68) + iVar4 * 0x24 + 0x20) = *(undefined4 *)(this + 0x7c);
*(int *)(this + 0x7c) = iVar4;
}
this_01 = *(CJob **)(iVar4 * 0x1c + *(int *)(this + 4) + 0x18);
if (*(int *)(this_01 + 0x34) != puVar1[3] || *(int *)(this_01 + 0x30) != puVar1[2]) {
CJobTime::CServerMicroSecsPassed((CJobTime *)(this_01 + 0x38));
if (-1 < extraout_EDX) {
CJob::Heartbeat(this_01);
}
goto LAB_000629d4;
}
puVar1[6] = puVar1[6] + -1;
CJob::Heartbeat(this_01);
if (puVar1[6] == 0) {
local_28 = *puVar1;
local_24 = puVar1[1];
CUtlRBTree<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Remove(this_00,(Node_t *)&local_28);
iVar4 = *(int *)(this + 0x74);
CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
::Unlink((CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
*)(this + 0x68),iVar4);
*(undefined4 *)(*(int *)(this + 0x68) + iVar4 * 0x24 + 0x20) = *(undefined4 *)(this + 0x7c);
*(int *)(this + 0x7c) = iVar4;
if (2 < *(int *)(this_01 + 0x24) - 3U) {
TimeoutJob(this,this_01);
}
}
else {
CJobTime::SetToJobTime((CJobTime *)(puVar1 + 4));
CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
::LinkBefore((CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
*)(this + 0x68),-1,*(int *)(this + 0x74));
local_28 = *puVar1;
local_24 = puVar1[1];
uVar3 = CUtlRBTree<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find(this_00,(Node_t *)&local_28);
if (uVar3 != 0xffff) {
*(undefined4 *)(*(int *)(this + 0x94) + (uint)uVar3 * 0x14 + 0x10) =
*(undefined4 *)(this + 0x78);
}
}
} while( true );
}
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.