]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/updatecommands
authorSamual Lenks <samual@xonotic.org>
Fri, 31 May 2013 15:23:18 +0000 (11:23 -0400)
committerSamual Lenks <samual@xonotic.org>
Fri, 31 May 2013 15:23:18 +0000 (11:23 -0400)
commands.cfg
qcsrc/client/command/cl_cmd.qc
qcsrc/server/command/banning.qc
qcsrc/server/command/sv_cmd.qc

index 70ee53ecb027ade180ba8dfe4855c0e9c4709d2e..c8c73fec3e2334e4683da30480800697efb8e7e8 100644 (file)
@@ -123,8 +123,6 @@ alias hud                  "qc_cmd_cl     hud                  ${* ?}" // Comman
 alias localprint           "qc_cmd_cl     localprint           ${* ?}" // Create your own centerprint sent to yourself
 //alias mv_download        "qc_cmd_cl     mv_download          ${* ?}" // Retrieve mapshot picture from the server
 alias sendcvar             "qc_cmd_cl     sendcvar             ${* ?}" // Send a cvar to the server (like weaponpriority)
-//alias vyes               "qc_cmd_cl     vyes                 ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
-//alias vno                "qc_cmd_cl     vno                  ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
 
 // other aliases for local commands
 alias hud_configure "qc_cmd_cl hud configure"
@@ -240,7 +238,6 @@ alias settemp_restore "qc_cmd_svcl settemp_restore"
 // ===================================
 alias ban                  "qc_cmd_sv     ban                  ${* ?}" // Ban an IP address or a range of addresses (like 1.2.3)
 alias banlist              "qc_cmd_sv     banlist              ${* ?}" // List all existing bans
-alias bans                 "qc_cmd_sv     bans                 ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
 alias kickban              "qc_cmd_sv     kickban              ${* ?}" // Disconnect a client and ban it at the same time
 alias unban                "qc_cmd_sv     unban                ${* ?}" // Remove an existing ban
 
@@ -316,8 +313,8 @@ set sv_vote_override_mostrecent 0
 alias vmaster   "qc_cmd_cmd vote master"
 alias vlogin    "qc_cmd_cmd vote master login ${* ?}"
 alias vdo       "qc_cmd_cmd vote master do ${* ?}"
-alias vyes      "qc_cmd_cl handlevote yes; cl_cmd vyes" // NOTE: COMPATIBILITY FOR 0.5 IS ADDED HERE WITH "VYES", REMOVE LATER
-alias vno       "qc_cmd_cl handlevote no; cl_cmd vno" // ^^^ same, see above
+alias vyes      "qc_cmd_cl handlevote yes"
+alias vno       "qc_cmd_cl handlevote no"
 alias vdontcare "qc_cmd_cmd vote abstain"
 alias vabstain  "qc_cmd_cmd vote abstain"
 
index acac8b3121574d22a2ec706a9f78849b5a404712..7926544d4b785d06c06aadf75377b0686c03c0a3 100644 (file)
@@ -349,7 +349,6 @@ void LocalCommand_(float request)
 // ==================================
 
 // Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-// but for 0.5 compat, we need vyes and vno here as they were replaced... REMOVE THEM AFTER 0.6 RELEASE!!!!
 #define CLIENT_COMMANDS(request,arguments) \
        CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
        CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
@@ -359,8 +358,6 @@ void LocalCommand_(float request)
        CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
        CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
        CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
-       CLIENT_COMMAND("vyes", LocalCommand_handlevote(request, tokenize_console("handlevote yes")), "") \
-       CLIENT_COMMAND("vno", LocalCommand_handlevote(request, tokenize_console("handlevote no")), "") \
        /* nothing */
        
 void LocalCommand_macro_help()
index eebadfa73b2d48ed5f3ad6573ae0390d72a228b6..1694bb661d0254dcd84e5d2e895de51244ea10b7 100644 (file)
@@ -107,6 +107,41 @@ void BanCommand_kickban(float request, float argc, string command)
        }
 }
 
+void BanCommand_mute(float request, float argc, string command) // TODO: Add a sort of mute-"ban" which allows players to be muted based on IP/cryptokey
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(argc >= 2)
+                       {
+                               entity client = GetFilteredEntity(argv(1));
+                               float accepted = VerifyClientEntity(client, TRUE, FALSE);
+                               
+                               if(accepted > 0) 
+                               {
+                                       client.muted = TRUE;
+                                       return;
+                               }
+                               else
+                               {
+                                       print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n"); 
+                               }
+                       }
+               }
+                       
+               default:
+                       print("Incorrect parameters for ^2mute^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 sv_cmd mute client\n");
+                       print("  'client' is the entity number or name of the player to mute.\n");
+                       print("See also: ^2unmute^7\n");
+                       return;
+               }
+       }
+}
+
 void BanCommand_unban(float request, float argc)
 {
        switch(request)
@@ -160,6 +195,41 @@ void BanCommand_unban(float request, float argc)
        }
 }
 
+void BanCommand_unmute(float request, float argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(argc >= 2)
+                       {
+                               entity client = GetFilteredEntity(argv(1));
+                               float accepted = VerifyClientEntity(client, TRUE, FALSE);
+                               
+                               if(accepted > 0) 
+                               {
+                                       client.muted = FALSE;
+                                       return;
+                               }
+                               else
+                               {
+                                       print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n"); 
+                               }
+                       }
+               }
+                       
+               default:
+                       print("Incorrect parameters for ^2mute^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 sv_cmd unmute client\n");
+                       print("  'client' is the entity number or name of the player to unmute.\n");
+                       print("See also: ^2mute^7\n");
+                       return;
+               }
+       }
+}
+
 /* use this when creating a new command, making sure to place it in alphabetical order... also,
 ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
 void BanCommand_(float request)
@@ -189,13 +259,13 @@ void BanCommand_(float request)
 // ==================================
 
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-// but for 0.5 compat, we need "bans" here as it was replaced... REMOVE IT AFTER 0.6 RELEASE!!!!
 #define BAN_COMMANDS(request,arguments,command) \
        BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \
        BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \
-       BAN_COMMAND("bans", BanCommand_banlist(request), "") \
        BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \
+       BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \
        BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \
+       BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \
        /* nothing */
 
 void BanCommand_macro_help()
index 9f4ff7c20ef65e515be38bbd0a9cfa2621de44b7..ba9b48a294a7ea5f9bc4bbda9eff993f0c8168b2 100644 (file)
@@ -1721,7 +1721,6 @@ void GameCommand_(float request)
 // ==================================
 
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-// Common commands have double indentation to separate them a bit.
 #define SERVER_COMMANDS(request,arguments,command) \
        SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
        SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \