Host_AccumulateTime
0x00175fb0 · 666 bytes · __cdecl
_Z19Host_AccumulateTimef
Decompiled
undefined (1 param)
/* Host_AccumulateTime(float) */
void Host_AccumulateTime(float param_1)
{
float fVar1;
int *piVar2;
int iVar3;
uint uVar4;
float fVar5;
host_frametime = param_1;
realtime = realtime + param_1;
if (g_bDedicatedServerBenchmarkMode != '\0') {
host_frametime = DAT_003a1730;
}
uVar4 = -(uint)(0.0 < *(float *)(host_timescale._28_4_ + 0x2c));
fVar5 = *(float *)(host_framerate._28_4_ + 0x2c);
if (fVar5 == 0.0) {
fVar5 = (float)(~uVar4 & 0x3f800000 | (uint)*(float *)(host_timescale._28_4_ + 0x2c) & uVar4) *
DAT_003b8070;
if (fVar5 == 1.0) {
piVar2 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar2 + 0xc))(piVar2,"-tools",0);
host_frametime_unbounded = host_frametime;
if (iVar3 == 0) {
if (0.1 <= host_frametime) {
host_frametime = 0.1;
}
}
else if (2.0 <= host_frametime) {
host_frametime = 2.0;
}
host_frametime_unscaled = host_frametime;
if (host_frametime <= 0.001) {
host_frametime_unscaled = 0.001;
host_frametime = 0.001;
}
}
else {
host_frametime_unscaled = host_frametime;
host_frametime_unbounded = host_frametime * fVar5;
host_frametime = host_frametime_unbounded;
piVar2 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar2 + 0xc))(piVar2,"-tools",0);
if (iVar3 == 0) {
fVar1 = fVar5 * 0.1;
if (host_frametime <= fVar5 * 0.1) {
fVar1 = host_frametime;
}
host_frametime = fVar1;
if (0.1 <= host_frametime_unscaled) {
host_frametime_unscaled = 0.1;
}
}
else {
fVar1 = fVar5 + fVar5;
if (host_frametime <= fVar5 + fVar5) {
fVar1 = host_frametime;
}
host_frametime = fVar1;
if (2.0 <= host_frametime_unscaled) {
host_frametime_unscaled = 2.0;
}
}
if (host_frametime_unscaled <= 0.001) {
host_frametime_unscaled = 0.001;
}
}
}
else if (fVar5 <= 1.0) {
host_frametime_unscaled = fVar5;
host_frametime_unbounded = fVar5;
host_frametime = fVar5;
if ((fVar5 < -1.0) &&
(host_frametime_unscaled = 1.0 / ABS(fVar5),
host_frametime_unbounded = host_frametime_unscaled, host_frametime = host_frametime_unscaled,
param_1 <= host_frametime_unscaled)) {
host_frametime_unscaled = param_1;
host_frametime_unbounded = param_1;
host_frametime = param_1;
}
}
else {
host_frametime_unscaled = 1.0 / fVar5;
host_frametime_unbounded = host_frametime_unscaled;
host_frametime = host_frametime_unscaled;
}
if (g_pSoundServices != (int *)0x0) {
(**(code **)(*g_pSoundServices + 0x1c))(g_pSoundServices,param_1,host_frametime);
}
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.