CHLTVClient::ExecuteStringCommand
0x00168ed0 · 1258 bytes · __thiscall
_ZN11CHLTVClient20ExecuteStringCommandEPKc
Decompiled
undefined (2 params)
/* CHLTVClient::ExecuteStringCommand(char const*) */
undefined4 __thiscall CHLTVClient::ExecuteStringCommand(CHLTVClient *this,char *param_1)
{
code *pcVar1;
char cVar2;
int iVar3;
undefined4 uVar4;
int *piVar5;
undefined4 uVar6;
undefined4 uVar7;
undefined4 uVar8;
int iVar9;
char *pcVar10;
int in_GS_OFFSET;
longdouble lVar11;
undefined4 local_638;
int local_634;
int local_630;
char local_62c [260];
int local_528 [258];
char *local_120;
char *local_11c;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
cVar2 = CBaseClient::ExecuteStringCommand((CBaseClient *)this,param_1);
if (((cVar2 == '\0') && (param_1 != (char *)0x0)) && (*param_1 != '\0')) {
CCommand::CCommand((CCommand *)local_528);
cVar2 = CCommand::Tokenize((CCommand *)local_528,param_1,(characterset_t *)0x0);
if (cVar2 != '\0') {
pcVar10 = "";
if (0 < local_528[0]) {
pcVar10 = local_120;
}
iVar3 = _V_stricmp(pcVar10,"spec_next");
if (iVar3 != 0) {
iVar3 = _V_stricmp(pcVar10,"spec_prev");
if (iVar3 != 0) {
iVar3 = _V_stricmp(pcVar10,"spec_mode");
if (iVar3 != 0) {
iVar3 = _V_stricmp(pcVar10,"say");
if ((iVar3 == 0) && (1 < local_528[0])) {
if ((0.0 < *(float *)(tv_chattimelimit._28_4_ + 0x2c)) &&
((double)*(float *)(tv_chattimelimit._28_4_ + 0x2c) + *(double *)(this + 0x1d750)
<= net_time)) {
*(double *)(this + 0x1d750) = net_time;
uVar4 = (**(code **)(*(int *)this + 0x1c))(this);
V_snprintf(local_62c,0x80,"%s : %s",uVar4,local_11c);
CHLTVServer::BroadcastLocalChat
(*(CHLTVServer **)(this + 0x1d79c),local_62c,(char *)(this + 0x1d759));
}
}
else {
iVar3 = _V_strcmp(pcVar10,"tv_chatgroup");
if (iVar3 == 0) {
if (local_528[0] < 2) {
(**(code **)(*(int *)this + 0x68))
(this,"Your current chat group is \"%s\"\n",this + 0x1d759);
}
else {
V_strncpy((char *)(this + 0x1d759),local_11c,0x40);
}
}
else {
iVar3 = _V_strcmp(pcVar10,"status");
if (iVar3 == 0) {
V_FileBase(com_gamedir,local_62c,0x104);
cVar2 = (**(code **)(**(int **)(this + 0x1d79c) + 0x54))
(*(int **)(this + 0x1d79c));
if (cVar2 == '\0') {
iVar9 = (**(code **)(**(int **)(this + 0x1d79c) + 0x5c))
(*(int **)(this + 0x1d79c));
pcVar1 = *(code **)(*(int *)this + 0x68);
iVar3 = **(int **)(this + 0x1d79c);
if (iVar9 == 0) {
uVar4 = (**(code **)(iVar3 + 0x30))(*(int **)(this + 0x1d79c));
(*pcVar1)(this,"SourceTV Relay \"%s\", not connect.\n",uVar4);
}
else {
uVar4 = (**(code **)(iVar3 + 0x30))();
(*pcVar1)(this,"SourceTV Relay \"%s\", connected.\n",uVar4);
}
}
else {
pcVar1 = *(code **)(*(int *)this + 0x68);
piVar5 = (int *)(**(code **)(**(int **)(this + 0x1d79c) + 0x40))
(*(int **)(this + 0x1d79c));
lVar11 = (longdouble)(**(code **)(*piVar5 + 0x20))(piVar5);
uVar4 = (**(code **)(**(int **)(this + 0x1d79c) + 0x30))
(*(int **)(this + 0x1d79c));
(*pcVar1)(this,"SourceTV Master \"%s\", delay %.0f\n",uVar4,
(double)(float)lVar11);
}
pcVar1 = *(code **)(*(int *)this + 0x68);
uVar4 = build_number();
lVar11 = (longdouble)
(**(code **)(**(int **)(this + 0x1d79c) + 0x48))
(*(int **)(this + 0x1d79c));
uVar6 = COM_FormatSeconds((int)lVar11);
uVar7 = (**(code **)(*(int *)(*(int *)(this + 0x1d79c) + 4) + 0x24))
(*(int *)(this + 0x1d79c) + 4);
uVar8 = netadr_s::ToString((netadr_s *)&net_local_adr,true);
(*pcVar1)(this,"IP %s:%i, Online %s, Version %i (%s)\n",uVar8,uVar7,uVar6,uVar4,
"Linux");
pcVar1 = *(code **)(*(int *)this + 0x68);
uVar4 = (**(code **)(*(int *)(*(int *)(this + 0x1d79c) + 4) + 0x50))
(*(int *)(this + 0x1d79c) + 4);
uVar6 = (**(code **)(*(int *)(*(int *)(this + 0x1d79c) + 4) + 0x3c))
(*(int *)(this + 0x1d79c) + 4);
lVar11 = (longdouble)
(**(code **)(*(int *)(*(int *)(this + 0x1d79c) + 4) + 0x28))
(*(int *)(this + 0x1d79c) + 4);
uVar7 = COM_FormatSeconds((int)lVar11);
(*pcVar1)(this,"Game Time %s, Mod \"%s\", Map \"%s\", Players %i\n",uVar7,
local_62c,uVar6,uVar4);
(**(code **)(**(int **)(this + 0x1d79c) + 0x4c))
(*(int **)(this + 0x1d79c),&local_634,&local_638,&local_630);
(**(code **)(*(int *)this + 0x68))
(this,"Local Slots %i, Spectators %i, Proxies %i\n",local_638,
local_630 - local_634,local_634);
(**(code **)(**(int **)(this + 0x1d79c) + 0x50))
(*(int **)(this + 0x1d79c),&local_634,&local_638,&local_630);
(**(code **)(*(int *)this + 0x68))
(this,"Total Slots %i, Spectators %i, Proxies %i\n",local_638,
local_630 - local_634,local_634);
}
else {
DevMsg("CHLTVClient::ExecuteStringCommand: Unknown command %s.\n",param_1);
}
}
}
goto LAB_00168f06;
}
}
}
(**(code **)(*(int *)this + 0x68))
(this,"Camera settings can\'t be changed during a live broadcast.\n");
}
}
LAB_00168f06:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return 1;
}
/* 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.