maxplayers
0x001fba70 · 239 bytes · __cdecl
_ZL10maxplayersRK8CCommand
Decompiled
undefined (1 param)
/* maxplayers(CCommand const&) */
void maxplayers(CCommand *param_1)
{
undefined4 uVar1;
int iVar2;
undefined4 local_18;
undefined4 local_14;
undefined4 local_10 [3];
if (*(int *)param_1 != 2) {
uVar1 = CBaseServer::GetMaxClients((CBaseServer *)&sv);
ConMsg("\"maxplayers\" is \"%u\"\n",uVar1);
if (serverGameClients != (undefined4 *)0x0) {
local_18 = 1;
local_14 = 1;
local_10[0] = 1;
(**(code **)*serverGameClients)(serverGameClients,&local_18,&local_14,local_10);
ConMsg("\"mininum_maxplayers\" is \"%u\"\n",local_18);
ConMsg("\"absolute_maxplayers\" is \"%u\"\n",local_14);
ConMsg("\"default_maxplayers\" is \"%u\"\n",local_10[0]);
ConMsg("\"max_splitscreen_players\" is \"%u\"\n",DAT_003a1734);
}
return;
}
if (DAT_003b7f64 < 2) {
iVar2 = V_atoi(*(char **)(param_1 + 0x40c));
CGameServer::SetMaxClients((CGameServer *)&sv,iVar2);
return;
}
ConMsg("Cannot change maxplayers while the server is running\n");
return;
}
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.