]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Remove the other half of checkfail
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 1bd7097954693b3560562c12a7be8f3b92042935..a34752c9c76587b079be74788917a245343ebcdf 100644 (file)
@@ -87,28 +87,6 @@ void ClientCommand_autoswitch(float request, float argc)
        }
 }
 
-void ClientCommand_checkfail(float request, string command) // internal command, used only by code
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       LOG_INFOF("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
-                       self.checkfail = 1;
-                       return; // never fall through to usage
-               }
-
-               default:
-                       sprint(self, "Incorrect parameters for ^2checkfail^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       sprint(self, "\nUsage:^3 cmd checkfail <message>\n");
-                       sprint(self, "  Where 'message' is the message reported by client about the fail.\n");
-                       return;
-               }
-       }
-}
-
 void ClientCommand_clientversion(float request, float argc) // internal command, used only by code
 {
        switch(request)
@@ -560,7 +538,18 @@ void ClientCommand_tell(float request, float argc, string command)
                                {
                                        if(tell_to != self) // and we're allowed to send to them :D
                                        {
-                                               Say(self, false, tell_to, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)), true);
+                                               // workaround for argv indexes indexing ascii chars instead of utf8 chars
+                                               // In this case when the player name contains utf8 chars
+                                               // the message gets partially trimmed in the beginning.
+                                               // Potentially this bug affects any substring call that uses
+                                               // argv_start_index and argv_end_index.
+
+                                               string utf8_enable_save = cvar_string("utf8_enable");
+                                               cvar_set("utf8_enable", "0");
+                                               string msg = substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token));
+                                               cvar_set("utf8_enable", utf8_enable_save);
+
+                                               Say(self, false, tell_to, msg, true);
                                                return;
                                        }
                                        else { print_to(self, "You can't ^2tell^7 a message to yourself."); return; }
@@ -645,7 +634,6 @@ void ClientCommand_(float request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #define CLIENT_COMMANDS(request,arguments,command) \
        CLIENT_COMMAND("autoswitch", ClientCommand_autoswitch(request, arguments), "Whether or not to switch automatically when getting a better weapon") \
-       CLIENT_COMMAND("checkfail", ClientCommand_checkfail(request, command), "Report if a client-side check failed") \
        CLIENT_COMMAND("clientversion", ClientCommand_clientversion(request, arguments), "Release version of the game") \
        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") \