ProcessQueryCacheUpdate
0x0049d630 · 287 bytes · __cdecl
_Z23ProcessQueryCacheUpdateR24QueryCacheUpdateRecord_t
Decompiled
undefined (1 param)
/* ProcessQueryCacheUpdate(QueryCacheUpdateRecord_t&) */
void ProcessQueryCacheUpdate(QueryCacheUpdateRecord_t *param_1)
{
float fVar1;
QueryCacheEntry_t *pQVar2;
QueryCacheEntry_t *this;
int iVar3;
float fVar4;
iVar3 = 0;
fVar1 = *(float *)(gpGlobals + 0xc);
if (0 < *(int *)(param_1 + 4)) {
do {
pQVar2 = (QueryCacheEntry_t *)(&s_HashChains)[*(int *)param_1 + iVar3];
while (this = pQVar2, this != (QueryCacheEntry_t *)0x0) {
pQVar2 = *(QueryCacheEntry_t **)this;
fVar4 = fVar1 - *(float *)(this + 0x60);
if (this[100] == (QueryCacheEntry_t)0x0) {
if (*(float *)(this + 0x5c) <= fVar4 && fVar4 != *(float *)(this + 0x5c)) {
if (this[0x65] != (QueryCacheEntry_t)0x0) {
s_WastedSpeculativeUpdates = s_WastedSpeculativeUpdates + 1;
}
*(undefined4 *)(this + 8) = 0;
if (*(int **)(this + 4) == (int *)0x0) {
if ((this == (QueryCacheEntry_t *)(&s_HashChains)[*(int *)(this + 0x50)]) &&
((&s_HashChains)[*(int *)(this + 0x50)] = pQVar2,
pQVar2 != (QueryCacheEntry_t *)0x0)) {
*(undefined4 *)(pQVar2 + 4) = 0;
}
}
else {
**(int **)(this + 4) = (int)pQVar2;
if (*(int *)this != 0) {
*(undefined4 *)(*(int *)this + 4) = *(undefined4 *)(this + 4);
}
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)this = *(undefined4 *)(param_1 + 8);
if (*(int *)(param_1 + 8) == 0) {
*(QueryCacheEntry_t **)(param_1 + 0xc) = this;
}
else {
*(QueryCacheEntry_t **)(*(int *)(param_1 + 8) + 4) = this;
}
*(undefined4 *)(this + 4) = 0;
*(QueryCacheEntry_t **)(param_1 + 8) = this;
}
}
else if (*(float *)(this + 0x5c) <= fVar4) {
QueryCacheEntry_t::IssueQuery(this);
this[100] = (QueryCacheEntry_t)0x0;
this[0x65] = (QueryCacheEntry_t)0x1;
}
}
iVar3 = iVar3 + 1;
} while (iVar3 < *(int *)(param_1 + 4));
}
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.