CVEngineServer::ClientCommand
0x0022dd00 · 383 bytes · __thiscall
_ZN14CVEngineServer13ClientCommandEP7edict_tPKcz
Decompiled
undefined (3 params)
/* CVEngineServer::ClientCommand(edict_t*, char const*, ...) */
void __thiscall
CVEngineServer::ClientCommand(CVEngineServer *this,edict_t *param_1,char *param_2,...)
{
int iVar1;
undefined4 uVar2;
int *piVar3;
int in_GS_OFFSET;
undefined **local_460;
undefined1 local_45c;
undefined4 local_458;
undefined4 local_454;
undefined4 local_450;
undefined8 local_44c;
undefined4 local_444;
undefined4 local_440;
undefined8 local_43c;
undefined4 local_434;
undefined4 local_430;
undefined1 local_42c;
undefined8 local_428;
undefined4 local_420;
undefined4 local_41c;
undefined1 *local_414;
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
V_vsnprintf(&ClientCommand(edict_t*,char_const*,...)::szOut,0x400,param_2,&stack0x00000010);
if (ClientCommand(edict_t*,char_const*,...)::szOut == '\0') {
Warning("ClientCommand, 0 length string supplied.\n");
}
else {
iVar1 = NUM_FOR_EDICT(param_1);
if ((iVar1 < 1) || (DAT_003b8080 < iVar1)) {
uVar2 = CBaseServer::GetMaxClients((CBaseServer *)&sv);
ConMsg("\n!!!\n\nStuffCmd: Some entity tried to stuff \'%s\' to console buffer of entity %i when maxclients was set to %i, ignoring\n\n"
,&ClientCommand(edict_t*,char_const*,...)::szOut,iVar1,uVar2);
}
else {
local_454 = 0;
local_450 = 0;
local_44c = 0;
local_444 = 0;
local_440 = 0;
local_43c = 0;
local_434 = 0;
local_430 = 0;
local_42c = 0;
local_428 = 0;
local_420 = 0;
local_41c = 0;
local_45c = 1;
local_458 = 0;
local_460 = &PTR__NET_StringCmd_002a17c8;
local_414 = &ClientCommand(edict_t*,char_const*,...)::szOut;
iVar1 = *(int *)(DAT_003b8074 + -4 + iVar1 * 4);
piVar3 = (int *)0x0;
if (iVar1 != 0) {
piVar3 = (int *)(iVar1 + 4);
}
(**(code **)(*piVar3 + 0x78))(piVar3,&local_460,0,0);
}
}
if (local_10 == *(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.