CHLTVClientState::UpdateStats
0x0016c2e0 · 911 bytes · __thiscall
_ZN16CHLTVClientState11UpdateStatsEv
Decompiled
undefined (1 param)
/* CHLTVClientState::UpdateStats() */
void __thiscall CHLTVClientState::UpdateStats(CHLTVClientState *this)
{
int iVar1;
undefined4 uVar2;
undefined4 uVar3;
int in_GS_OFFSET;
int local_294;
int local_290;
int local_28c;
undefined **local_288;
undefined1 local_284;
undefined4 local_280;
undefined4 local_27c;
undefined4 local_278;
undefined8 local_274;
undefined4 local_26c;
undefined4 local_268;
undefined8 local_264;
undefined4 local_25c;
undefined4 local_258;
undefined1 local_254;
undefined8 local_250;
undefined4 local_248;
undefined4 local_244;
undefined4 local_23c;
undefined4 local_238;
undefined4 local_234;
int local_230;
undefined4 local_22c;
NetMessageCvar_t local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(this + 0x60) < 6) {
*(undefined4 *)(this + 0x49e8) = 0;
}
else if ((double)*(float *)(this + 0x49e8) <= net_time) {
*(float *)(this + 0x49e8) = (float)(net_time + 8.0);
CHLTVServer::GetRelayStats(*(CHLTVServer **)(this + 0x49ec),&local_294,&local_290,&local_28c);
local_294 = local_294 + 1;
iVar1 = (**(code **)(*(int *)(*(int *)(this + 0x49ec) + 4) + 0x18))(*(int *)(this + 0x49ec) + 4)
;
local_290 = local_290 + iVar1;
iVar1 = (**(code **)(*(int *)(*(int *)(this + 0x49ec) + 4) + 0xc))(*(int *)(this + 0x49ec) + 4);
local_28c = local_28c + iVar1;
local_27c = 0;
local_278 = 0;
local_274 = 0;
local_26c = 0;
local_268 = 0;
local_264 = 0;
local_25c = 0;
local_258 = 0;
local_254 = 0;
local_250 = 0;
local_248 = 0;
local_244 = 0;
local_284 = 1;
local_280 = 0;
local_288 = &PTR__NET_SetConVar_002a1ca8;
local_23c = 0;
local_238 = 0;
local_234 = 0;
local_230 = 0;
local_22c = 0;
/* try { // try from 0016c49b to 0016c637 has its CatchHandler @ 0016c672 */
V_strncpy((char *)local_228,"hltv_proxies",0x104);
V_snprintf(local_124,0x104,"%d",local_294);
CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)&local_23c,local_230
,local_228);
V_strncpy((char *)local_228,"hltv_clients",0x104);
V_snprintf(local_124,0x104,"%d",local_28c);
CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)&local_23c,local_230
,local_228);
V_strncpy((char *)local_228,"hltv_slots",0x104);
V_snprintf(local_124,0x104,"%d",local_290);
CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)&local_23c,local_230
,local_228);
V_strncpy((char *)local_228,"hltv_addr",0x104);
uVar2 = (**(code **)(*(int *)(*(int *)(this + 0x49ec) + 4) + 0x24))(*(int *)(this + 0x49ec) + 4)
;
uVar3 = netadr_s::ToString((netadr_s *)&net_local_adr,true);
V_snprintf(local_124,0x104,"%s:%u",uVar3,uVar2);
CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)&local_23c,local_230
,local_228);
(**(code **)(**(int **)(this + 0x10) + 0xa8))(*(int **)(this + 0x10),&local_288,0,0);
local_288 = &PTR__NET_SetConVar_002a1ca8;
local_230 = 0;
CUtlMemory<NetMessageCvar_t,int>::Purge((CUtlMemory<NetMessageCvar_t,int> *)&local_23c);
local_22c = local_23c;
CUtlMemory<NetMessageCvar_t,int>::Purge((CUtlMemory<NetMessageCvar_t,int> *)&local_23c);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.