X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcmd.qc;h=c4e85e28ef55d37debee2e5fc81c9da48ae7b419;hb=6018d119b3c9f4e54d6d21f6339948708c83d83f;hp=8a086fcd5aaa43c9e82c8de7d7b562b85fb40f07;hpb=b517c2b5df8b140a9385b0b20832d293daf66252;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 8a086fcd5..c4e85e28e 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -226,40 +226,6 @@ void ClientCommand_ready(float request) // todo: anti-spam for toggling readynes } } -void ClientCommand_reportcvar(float request, float argc, string command) -{ - switch(request) - { - case CMD_REQUEST_COMMAND: - { - if(argv(1) != "") - { - float tokens; - string s; - - if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then - { - s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\""); - tokens = tokenize_console(s); - } - - GetCvars(1); - - return; - } - } - - default: - sprint(self, "Incorrect parameters for ^2reportcvar^7\n"); - case CMD_REQUEST_USAGE: - { - sprint(self, "\nUsage:^3 cmd reportcvar \n"); - sprint(self, " Where 'cvar' is the cvar plus arguments to send to the server.\n"); - return; - } - } -} - void ClientCommand_say(float request, float argc, string command) { switch(request) @@ -324,7 +290,7 @@ void ClientCommand_selectteam(float request, float argc) case "pink": selection = COLOR_TEAM4; break; case "auto": selection = (-1); break; - default: break; + default: selection = 0; break; } if(selection) @@ -392,13 +358,13 @@ void ClientCommand_sentcvar(float request, float argc, string command) { if(argv(1) != "") { - float tokens; + //float tokens; string s; if(argc == 2) // undefined cvar: use the default value on the server then { s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\""); - tokens = tokenize_console(s); + tokenize_console(s); } GetCvars(1); @@ -445,7 +411,7 @@ void ClientCommand_spectate(float request) if(self.classname == "player" && autocvar_sv_spectate == 1) ClientKill_TeamChange(-2); // observe - // in CA, allow a dead player to move to spectatators (without that, caplayer!=0 will be moved back to the player list) + // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list) // note: if arena game mode is ever done properly, this needs to be removed. if(g_ca && self.caplayer && (self.classname == "spectator" || self.classname == "observer")) { @@ -595,7 +561,6 @@ void ClientCommand_(float request) CLIENT_COMMAND("mv_getpicture", ClientCommand_mv_getpicture(request, arguments), "Retrieve mapshot picture from the server") \ CLIENT_COMMAND("join", ClientCommand_join(request), "Become a player in the game") \ CLIENT_COMMAND("ready", ClientCommand_ready(request), "Qualify as ready to end warmup stage (or restart server if allowed)") \ - CLIENT_COMMAND("reportcvar", ClientCommand_reportcvar(request, arguments, command), "Old system for sending a client cvar to the server") \ CLIENT_COMMAND("say", ClientCommand_say(request, arguments, command), "Print a message to chat to all players") \ CLIENT_COMMAND("say_team", ClientCommand_say_team(request, arguments, command), "Print a message to chat to all team mates") \ CLIENT_COMMAND("selectteam", ClientCommand_selectteam(request, arguments), "Attempt to choose a team to join into") \ @@ -658,6 +623,10 @@ void ClientCommand_macro_write_aliases(float fh) void SV_ParseClientCommand(string command) { + // if we're banned, don't even parse the command + if(Ban_MaybeEnforceBanOnce(self)) + return; + float argc = tokenize_console(command); // for the mutator hook system @@ -679,7 +648,6 @@ void SV_ParseClientCommand(string command) case "mv_getpicture": break; // handled by server in this file case "pause": break; // handled by engine in host_cmd.c case "prespawn": break; // handled by engine in host_cmd.c - case "reportcvar": break; // handled by server in this file case "sentcvar": break; // handled by server in this file case "spawn": break; // handled by engine in host_cmd.c