CMultiplayRules::ClientCommand
0x0046feb0 · 716 bytes · __thiscall
_ZN15CMultiplayRules13ClientCommandEP11CBaseEntityRK8CCommand
Decompiled
undefined (3 params)
/* CMultiplayRules::ClientCommand(CBaseEntity*, CCommand const&) */
undefined4 __thiscall
CMultiplayRules::ClientCommand(CMultiplayRules *this,CBaseEntity *param_1,CCommand *param_2)
{
char cVar1;
ushort uVar2;
int iVar3;
undefined4 uVar4;
uint uVar5;
char *pcVar6;
uint uVar7;
uint uVar8;
long lVar9;
long lVar10;
int *piVar11;
CBaseEntity *pCVar12;
if ((param_1 == (CBaseEntity *)0x0) ||
(cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 == '\0')) {
iVar3 = *(int *)param_2;
pCVar12 = (CBaseEntity *)0x0;
if (iVar3 < 1) goto LAB_004700ac;
LAB_0046fee5:
pcVar6 = *(char **)(param_2 + 0x408);
if (pcVar6 == "voicemenu") goto LAB_00470002;
iVar3 = _V_stricmp(pcVar6,"voicemenu");
if (iVar3 != 0) {
if (pcVar6 == "achievement_earned") goto LAB_0046ff3b;
LAB_0046ff23:
iVar3 = _V_stricmp(pcVar6,"achievement_earned");
if (iVar3 != 0) {
uVar4 = CGameRules::ClientCommand((CGameRules *)this,param_1,param_2);
return uVar4;
}
LAB_0046ff3b:
if (param_1 == (CBaseEntity *)0x0) {
return 1;
}
uVar4 = (**(code **)(*(int *)param_1 + 0x738))(param_1);
if ((char)uVar4 == '\0') {
return 1;
}
uVar2 = UTIL_GetAchievementEventMask();
uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
pcVar6 = "";
if (1 < *(int *)param_2) {
pcVar6 = *(char **)(param_2 + 0x40c);
}
uVar7 = strtol(pcVar6,(char **)0x0,10);
pcVar6 = "";
if (2 < *(int *)param_2) {
pcVar6 = *(char **)(param_2 + 0x410);
}
uVar8 = strtol(pcVar6,(char **)0x0,10);
if ((uVar7 ^ uVar5) != uVar8) {
return 1;
}
piVar11 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"achievement_earned",0,0);
if (piVar11 != (int *)0x0) {
if (*(int *)(param_1 + 0x30) == 0) {
iVar3 = 0;
}
else {
iVar3 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar11 + 0x30))(piVar11,"player",iVar3);
(**(code **)(*piVar11 + 0x30))(piVar11,"achievement",uVar2 ^ uVar7);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar11,0);
}
(**(code **)(*(int *)param_1 + 0x7c8))(param_1,uVar2 ^ uVar7);
return uVar4;
}
}
else {
iVar3 = *(int *)param_2;
pCVar12 = param_1;
if (0 < iVar3) goto LAB_0046fee5;
LAB_004700ac:
iVar3 = _V_stricmp("","voicemenu");
if (iVar3 != 0) {
pcVar6 = "";
goto LAB_0046ff23;
}
}
iVar3 = *(int *)param_2;
LAB_00470002:
if (((2 < iVar3) && (pCVar12 != (CBaseEntity *)0x0)) &&
(iVar3 = __dynamic_cast(pCVar12,&CBasePlayer::typeinfo,&CBaseMultiplayerPlayer::typeinfo,0),
iVar3 != 0)) {
lVar9 = strtol(*(char **)(param_2 + 0x40c),(char **)0x0,10);
pcVar6 = "";
if (2 < *(int *)param_2) {
pcVar6 = *(char **)(param_2 + 0x410);
}
lVar10 = strtol(pcVar6,(char **)0x0,10);
(**(code **)(*(int *)this + 0x22c))(this,iVar3,lVar9,lVar10);
}
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.