#include "cmd.qh"
+
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
+
#include <common/command/_mod.qh>
#include "common.qh"
bool SV_ParseClientCommand_floodcheck(entity this)
{
+ entity store = IS_CLIENT(this) ? CS(this) : this; // unfortunately, we need to store these on the client initially
+
if (!timeout_status) // not while paused
{
- if (time <= (this.cmd_floodtime + autocvar_sv_clientcommand_antispam_time))
+ if (time <= (store.cmd_floodtime + autocvar_sv_clientcommand_antispam_time))
{
- this.cmd_floodcount += 1;
- if (this.cmd_floodcount > autocvar_sv_clientcommand_antispam_count) return false; // too much spam, halt
+ store.cmd_floodcount += 1;
+ if (store.cmd_floodcount > autocvar_sv_clientcommand_antispam_count) return false; // too much spam, halt
}
else
{
- this.cmd_floodtime = time;
- this.cmd_floodcount = 1;
+ store.cmd_floodtime = time;
+ store.cmd_floodcount = 1;
}
}
return true; // continue, as we're not flooding yet
{
if (argv(1) != "")
{
- caller.autoswitch = InterpretBoolean(argv(1));
- sprint(caller, strcat("^1autoswitch is currently turned ", (caller.autoswitch ? "on" : "off"), ".\n"));
+ CS(caller).autoswitch = InterpretBoolean(argv(1));
+ sprint(caller, strcat("^1autoswitch is currently turned ", (CS(caller).autoswitch ? "on" : "off"), ".\n"));
return;
}
}
}
default:
- sprint(caller, strcat("Current physics set: ^3", caller.cvar_cl_physics, "\n"));
+ sprint(caller, strcat("Current physics set: ^3", CS(caller).cvar_cl_physics, "\n"));
case CMD_REQUEST_USAGE:
{
sprint(caller, "\nUsage:^3 cmd physics <physics>\n");
tokenize_console(s);
}
- GetCvars(caller, 1);
+ GetCvars(caller, CS(caller), 1);
return;
}