CVoiceGameMgr::ClientCommand
0x00584520 · 522 bytes · __thiscall
_ZN13CVoiceGameMgr13ClientCommandEP11CBasePlayerRK8CCommand
Decompiled
undefined (3 params)
/* CVoiceGameMgr::ClientCommand(CBasePlayer*, CCommand const&) */
undefined4 __thiscall
CVoiceGameMgr::ClientCommand(CVoiceGameMgr *this,CBasePlayer *param_1,CCommand *param_2)
{
char *pcVar1;
int iVar2;
long lVar3;
uint uVar4;
undefined1 *puVar5;
int iVar6;
int local_30;
undefined4 local_20 [4];
if (*(int *)(param_1 + 0x30) == 0) {
iVar6 = *(int *)param_2;
local_30 = -1;
}
else {
iVar6 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
local_30 = iVar6 + -1;
if ((-1 < local_30) && (local_30 < *(int *)(this + 8))) {
pcVar1 = "";
if (0 < *(int *)param_2) {
pcVar1 = *(char **)(param_2 + 0x408);
}
iVar2 = _V_stricmp(pcVar1,"vban");
if ((iVar2 == 0) && (1 < *(int *)param_2)) {
iVar2 = 1;
do {
local_20[0] = 0;
sscanf(*(char **)(param_2 + iVar2 * 4 + 0x408),"%x",local_20);
if (iVar2 == 1) {
VoiceServerDebug("CVoiceGameMgr::ClientCommand: vban (0x%x) from %d\n",local_20[0],
local_30);
*(undefined4 *)(&DAT_00fb629c + iVar6 * 4) = local_20[0];
}
else {
VoiceServerDebug("CVoiceGameMgr::ClientCommand: invalid index (%d)\n",iVar2);
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)param_2);
return 1;
}
pcVar1 = "";
if (0 < *(int *)param_2) {
pcVar1 = *(char **)(param_2 + 0x408);
}
iVar6 = _V_stricmp(pcVar1,"VModEnable");
if (iVar6 == 0) {
if (1 < *(int *)param_2) {
lVar3 = strtol(*(char **)(param_2 + 0x40c),(char **)0x0,10);
VoiceServerDebug("CVoiceGameMgr::ClientCommand: VModEnable (%d)\n",(uint)(lVar3 != 0));
pcVar1 = "";
if (1 < *(int *)param_2) {
pcVar1 = *(char **)(param_2 + 0x40c);
}
lVar3 = strtol(pcVar1,(char **)0x0,10);
iVar6 = local_30 >> 5;
if (lVar3 == 0) {
uVar4 = ~(1 << ((byte)local_30 & 0x1f));
(&g_PlayerModEnable)[iVar6] = (&g_PlayerModEnable)[iVar6] & uVar4;
}
else {
uVar4 = 1 << ((byte)local_30 & 0x1f);
(&g_PlayerModEnable)[iVar6] = (&g_PlayerModEnable)[iVar6] | uVar4;
uVar4 = ~uVar4;
}
(&g_bWantModEnable)[iVar6] = (&g_bWantModEnable)[iVar6] & uVar4;
return 1;
}
return 0;
}
return 0;
}
iVar6 = *(int *)param_2;
}
if (iVar6 < 1) {
puVar5 = &DAT_00d539c2;
}
else {
puVar5 = *(undefined1 **)(param_2 + 0x408);
}
VoiceServerDebug("CVoiceGameMgr::ClientCommand: cmd %s from invalid client (%d)\n",puVar5,local_30
);
return 1;
}
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.