Host_ShowIPCCallCount
0x001781b0 · 492 bytes · unknown
_Z21Host_ShowIPCCallCountv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Host_ShowIPCCallCount() */
void Host_ShowIPCCallCount(void)
{
int *piVar1;
uint uVar2;
int iVar3;
int iVar4;
longdouble lVar5;
float fVar6;
if (*(int *)(host_ShowIPCCallCount._28_4_ + 0x30) != 0) {
if ((Host_ShowIPCCallCount()::s_nLastTick == '\0') &&
(iVar3 = __cxa_guard_acquire(&Host_ShowIPCCallCount()::s_nLastTick), iVar3 != 0)) {
Host_ShowIPCCallCount()::s_nLastTick = host_tickcount;
__cxa_guard_release(&Host_ShowIPCCallCount()::s_nLastTick);
}
if ((Host_ShowIPCCallCount()::s_nLastFrame == '\0') &&
(iVar3 = __cxa_guard_acquire(&Host_ShowIPCCallCount()::s_nLastFrame), iVar3 != 0)) {
Host_ShowIPCCallCount()::s_nLastFrame = host_framecount;
__cxa_guard_release(&Host_ShowIPCCallCount()::s_nLastFrame);
}
if (*(float *)(host_ShowIPCCallCount._28_4_ + 0x2c) <= 0.0) {
fVar6 = 0.0;
}
else {
fVar6 = 1.0 / *(float *)(host_ShowIPCCallCount._28_4_ + 0x2c);
}
lVar5 = (longdouble)Plat_FloatTime();
if (fVar6 <= (float)lVar5 - Host_ShowIPCCallCount()::s_flLastTime) {
piVar1 = (int *)SteamInternal_ContextInit(SteamClient()::s_CallbackCounterAndContext);
piVar1 = (int *)*piVar1;
if (piVar1 == (int *)0x0) {
uVar2 = SteamGameServer_GetIPCCallCount();
}
else {
uVar2 = (**(code **)(*piVar1 + 0x54))(piVar1);
}
iVar4 = host_framecount - Host_ShowIPCCallCount()::s_nLastFrame;
iVar3 = host_tickcount - Host_ShowIPCCallCount()::s_nLastTick;
if ((iVar3 != 0) && (iVar4 != 0)) {
fVar6 = (float)(uVar2 >> 0x10) * 65536.0 + (float)(uVar2 & 0xffff);
Msg("host_ShowIPCCallCount: %d IPC calls in the past [%d frames, %d ticks] Avg: [%.2f/frame, %.2f/tick]\n"
,uVar2,iVar4,iVar3,(double)(fVar6 / (float)iVar4),(double)(fVar6 / (float)iVar3));
Host_ShowIPCCallCount()::s_nLastTick = host_tickcount;
Host_ShowIPCCallCount()::s_nLastFrame = host_framecount;
Host_ShowIPCCallCount()::s_flLastTime = (float)lVar5;
}
}
}
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.