CHLTVServer::UpdateStats
0x00171c30 · 605 bytes · __thiscall
_ZN11CHLTVServer11UpdateStatsEv
Decompiled
undefined (1 param)
/* CHLTVServer::UpdateStats() */
void __thiscall CHLTVServer::UpdateStats(CHLTVServer *this)
{
char cVar1;
int *piVar2;
undefined4 uVar3;
undefined4 uVar4;
int in_GS_OFFSET;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
char local_40 [32];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((double)*(float *)(this + 0x538c) <= net_time) {
*(float *)(this + 0x538c) = (float)(net_time + 8.0);
cVar1 = (**(code **)(*(int *)this + 0x54))(this);
if ((cVar1 == '\0') && (*(int *)(this + 0x274) < 2)) {
piVar2 = (int *)(**(code **)(s_GameEventManager + 0x1c))
(&s_GameEventManager,"hltv_message",1,0);
if (piVar2 == (int *)0x0) goto LAB_00171c60;
(**(code **)(*piVar2 + 0x3c))(piVar2,&DAT_002b16af,"SourceTV reconnecting ...");
cVar1 = (**(code **)(*(int *)this + 0x54))(this);
}
else {
(**(code **)(*(int *)this + 0x50))(this,&local_4c,&local_48,&local_44);
piVar2 = (int *)(**(code **)(s_GameEventManager + 0x1c))
(&s_GameEventManager,"hltv_status",1,0);
if (piVar2 == (int *)0x0) goto LAB_00171c60;
cVar1 = (**(code **)(*(int *)this + 0x54))(this);
if ((cVar1 == '\0') && (*(int *)(tv_overridemaster._28_4_ + 0x30) == 0)) {
uVar3 = netadr_s::ToString((netadr_s *)(this + 0x63a4),false);
V_snprintf(local_40,0x20,"%s",uVar3);
}
else {
uVar3 = (**(code **)(*(int *)(this + 4) + 0x24))(this + 4);
uVar4 = netadr_s::ToString((netadr_s *)&net_local_adr,true);
V_snprintf(local_40,0x20,"%s:%u",uVar4,uVar3);
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"master",local_40);
(**(code **)(*piVar2 + 0x30))(piVar2,"clients",local_44);
(**(code **)(*piVar2 + 0x30))(piVar2,"slots",local_48);
(**(code **)(*piVar2 + 0x30))(piVar2,"proxies",local_4c);
cVar1 = (**(code **)(*(int *)this + 0x54))(this);
}
if (cVar1 == '\0') {
(**(code **)(*(int *)this + 0x60))(this,piVar2);
}
else {
(**(code **)(s_GameEventManager + 0x20))(&s_GameEventManager,piVar2,0);
}
}
LAB_00171c60:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.