tv_status
0x00174770 · 1084 bytes · __cdecl
_ZL9tv_statusRK8CCommand
Decompiled
undefined (1 param)
/* tv_status(CCommand const&) */
void tv_status(CCommand *param_1)
{
float fVar1;
char cVar2;
undefined4 uVar3;
undefined4 uVar4;
undefined4 uVar5;
int iVar6;
netadr_s *this;
int *piVar7;
int in_GS_OFFSET;
longdouble lVar8;
double dVar9;
double dVar10;
undefined8 in_stack_fffffea8;
undefined8 uVar11;
undefined4 local_138;
int local_134;
int local_130;
float local_12c;
float local_128;
char local_124 [260];
int local_20;
uVar5 = (undefined4)((ulonglong)in_stack_fffffea8 >> 0x20);
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_FileBase(com_gamedir,local_124,0x104);
if (hltv != (int *)0x0) {
cVar2 = (**(code **)(hltv[1] + 0x58))(hltv + 1);
if (cVar2 != '\0') {
(**(code **)(*hltv + 0x28))(hltv,&local_12c,&local_128);
local_12c = local_12c * 0.0009765625;
local_128 = local_128 * 0.0009765625;
ConMsg("--- SourceTV Status ---\n");
uVar3 = build_number();
dVar9 = (double)(float)hltv[0x14e1];
lVar8 = (longdouble)(**(code **)(*hltv + 0x48))(hltv);
uVar4 = COM_FormatSeconds((int)lVar8);
uVar11 = CONCAT44(uVar5,"Linux");
ConMsg("Online %s, FPS %.1f, Version %i (%s)\n",uVar4,SUB84(dVar9,0),
(int)((ulonglong)dVar9 >> 0x20),uVar3,"Linux");
cVar2 = (**(code **)(*hltv + 0x58))(hltv);
if (cVar2 == '\0') {
cVar2 = (**(code **)(*hltv + 0x54))(hltv);
if (cVar2 == '\0') {
iVar6 = (**(code **)(*hltv + 0x5c))();
if (iVar6 == 0) {
uVar5 = (**(code **)(*hltv + 0x30))(hltv);
ConMsg("Relay \"%s\", not connect.\n",uVar5);
}
else {
this = (netadr_s *)(**(code **)(*hltv + 0x5c))();
uVar5 = netadr_s::ToString(this,false);
uVar3 = (**(code **)(*hltv + 0x30))(hltv);
ConMsg("Relay \"%s\", connect to %s\n",uVar3,uVar5);
}
}
else {
piVar7 = (int *)(**(code **)(*hltv + 0x40))(hltv);
lVar8 = (longdouble)(**(code **)(*piVar7 + 0x20))(piVar7);
uVar5 = (**(code **)(*hltv + 0x30))(hltv);
ConMsg("Master \"%s\", delay %.0f\n",uVar5,SUB84((double)(float)lVar8,0),
(int)((ulonglong)(double)(float)lVar8 >> 0x20));
}
}
else {
ConMsg("Playing Demo File \"%s\"\n","TODO demo file name",SUB84(dVar9,0),
(int)((ulonglong)dVar9 >> 0x20),uVar3,uVar11);
}
uVar5 = (**(code **)(hltv[1] + 0x50))(hltv + 1);
uVar3 = (**(code **)(hltv[1] + 0x3c))(hltv + 1);
lVar8 = (longdouble)(**(code **)(hltv[1] + 0x28))(hltv + 1);
uVar4 = COM_FormatSeconds((int)lVar8);
ConMsg("Game Time %s, Mod \"%s\", Map \"%s\", Players %i\n",uVar4,local_124,uVar3,uVar5);
dVar10 = (double)local_128;
dVar9 = (double)local_12c;
uVar5 = (**(code **)(hltv[1] + 0x24))(hltv + 1);
uVar3 = netadr_s::ToString((netadr_s *)&net_local_adr,true);
ConMsg("Local IP %s:%i, KB/sec In %.1f, Out %.1f\n",uVar3,uVar5,SUB84(dVar9,0),
(int)((ulonglong)dVar9 >> 0x20),dVar10);
(**(code **)(*hltv + 0x4c))(hltv,&local_134,&local_138,&local_130);
ConMsg("Local Slots %i, Spectators %i, Proxies %i\n",local_138,local_130 - local_134,local_134
);
(**(code **)(*hltv + 0x50))(hltv,&local_134,&local_138,&local_130);
ConMsg("Total Slots %i, Spectators %i, Proxies %i\n",local_138,local_130 - local_134,local_134
);
cVar2 = CHLTVDemoRecorder::IsRecording((CHLTVDemoRecorder *)(hltv + 0x1301));
fVar1 = DAT_003a1730;
if (cVar2 != '\0') {
iVar6 = CHLTVDemoRecorder::GetRecordingTick((CHLTVDemoRecorder *)(hltv + 0x1301));
uVar5 = COM_FormatSeconds((int)((float)iVar6 * fVar1));
uVar3 = CHLTVDemoRecorder::GetDemoFile((CHLTVDemoRecorder *)(hltv + 0x1301));
ConMsg("Recording to \"%s\", length %s.\n",uVar3,uVar5);
}
goto LAB_001747ca;
}
}
ConMsg("SourceTV not active.\n");
LAB_001747ca:
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.