NET_AdjustLag
0x001c35c0 · 157 bytes · unknown
_Z13NET_AdjustLagv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* NET_AdjustLag() */
void NET_AdjustLag(void)
{
double dVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
dVar1 = net_time - NET_AdjustLag()::s_LastTime;
if (0.20000000298023224 < dVar1) {
fVar3 = 0.2;
}
else {
if (dVar1 <= 0.0) {
dVar1 = 0.0;
}
fVar3 = (float)dVar1;
}
NET_AdjustLag()::s_LastTime = net_time;
if (s_FakeLag != *(float *)(fakelag._28_4_ + 0x2c)) {
fVar2 = *(float *)(fakelag._28_4_ + 0x2c) - s_FakeLag;
fVar5 = ABS(fVar2);
fVar4 = fVar3 * 200.0;
if (fVar5 <= fVar3 * 200.0) {
fVar4 = fVar5;
}
if (fVar2 < 0.0) {
s_FakeLag = s_FakeLag - fVar4;
return;
}
s_FakeLag = s_FakeLag + fVar4;
}
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.