_Host_RunFrame_Server
0x00177030 · 1021 bytes · __cdecl
_Z21_Host_RunFrame_Serverb
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* _Host_RunFrame_Server(bool) */
void _Host_RunFrame_Server(bool param_1)
{
uint *puVar1;
float fVar2;
undefined8 uVar3;
undefined8 uVar4;
double dVar5;
char cVar6;
int iVar7;
int iVar8;
longdouble lVar9;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_44 = 0;
local_40 = 0;
if (_Plat_SetBenchmarkMode == 0) {
local_2c = 0;
}
else {
(**(code **)(_Plat_SetBenchmarkMode + 0x50))
(_Plat_SetBenchmarkMode,&local_44,0,0,0,0,"/data/src/engine/./host.cpp",0xacd,
&_Host_RunFrame_Server(bool)::tm_fmt,"(%s)%s","Game","_Host_RunFrame_Server");
local_2c = _Plat_SetBenchmarkMode;
}
iVar8 = _DAT_0040b9d4;
local_34 = local_44;
local_30 = local_40;
/* try { // try from 001772d6 to 00177336 has its CatchHandler @ 00177479 */
if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
(iVar7 = ThreadGetCurrentId(), iVar8 == iVar7)) {
if ((char *)*_DAT_0040b030 != "_Host_RunFrame_Server") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2b2762,(char *)0x0,0x2a83b6);
}
puVar1 = (uint *)(_DAT_0040b0bc + 4 + _DAT_0040b030[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
if ((_Host_RunFrame_Server(bool)::_counter == '\0') &&
(iVar8 = __cxa_guard_acquire(&_Host_RunFrame_Server(bool)::_counter), iVar8 != 0)) {
/* try { // try from 00177376 to 0017737a has its CatchHandler @ 00177448 */
_Host_RunFrame_Server(bool)::_counter =
(int *)CVProfile::FindOrCreateCounter(&g_VProfCurrentProfile,"ticks",0);
__cxa_guard_release(&_Host_RunFrame_Server(bool)::_counter);
__cxa_atexit(CVProfCounter::~CVProfCounter,&_Host_RunFrame_Server(bool)::_counter,&__dso_handle)
;
}
*_Host_RunFrame_Server(bool)::_counter = *_Host_RunFrame_Server(bool)::_counter + 1;
local_3c = 0;
local_38 = 0;
if (_g_Telemetry == 0) {
local_20 = 0;
}
else {
/* try { // try from 00177169 to 0017716b has its CatchHandler @ 00177475 */
(**(code **)(_g_Telemetry + 0x50))
(_g_Telemetry,&local_3c,0,0,0,0,"/data/src/engine/./host.cpp",0xacf,
&_Host_RunFrame_Server(bool)::tm_fmt,&DAT_002c48a3,"_Host_RunFrame_Server");
local_20 = _g_Telemetry;
}
fVar2 = *(float *)(vprof_server_spike_threshold._28_4_ + 0x2c);
uVar3 = rdtsc();
local_28 = local_3c;
local_24 = local_38;
/* try { // try from 00177196 to 001771b0 has its CatchHandler @ 0017747d */
lVar9 = (longdouble)Plat_FloatTime();
g_HostTimes._128_8_ = (undefined8)lVar9;
SV_Frame(param_1);
lVar9 = (longdouble)Plat_FloatTime();
g_HostTimes._184_8_ = ((double)g_HostTimes._184_8_ - (double)g_HostTimes._128_8_) + (double)lVar9;
uVar4 = rdtsc();
lVar9 = (longdouble)Plat_FloatTime();
if (2.0 < (float)lVar9 - CVProfSpikeDetector::GetTimeLast()::timeLast) {
lVar9 = (longdouble)Plat_FloatTime();
CVProfSpikeDetector::GetTimeLast()::timeLast = (float)lVar9;
iVar8 = ((int)((ulonglong)uVar4 >> 0x20) - (int)((ulonglong)uVar3 >> 0x20)) -
(uint)((uint)uVar4 < (uint)uVar3);
dVar5 = (double)CONCAT44(iVar8,(uint)uVar4 - (uint)uVar3);
if (iVar8 < 0) {
dVar5 = dVar5 + 1.8446744073709552e+19;
}
if ((double)fVar2 < dVar5 * _g_ClockSpeedMillisecondsMultiplier) {
g_VProfSignalSpike = 1;
}
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
iVar8 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar7 = ThreadGetCurrentId(), iVar8 == iVar7)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
}
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.