]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/banning.qc
Survival: show hunters to other hunters in the scoreboard. It fixes #2844
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / banning.qc
index 52c7e9c431d9ce75872fb8695d28a85636b8675d..b4f0bb3082a4980bb4ed6e9c31f1b958a88b1246 100644 (file)
@@ -1,6 +1,7 @@
 #include "banning.qh"
 
 #include <common/command/_mod.qh>
+#include <common/minigames/sv_minigames.qh>
 #include <common/state.qh>
 #include <common/stats.qh>
 #include <common/util.qh>
@@ -133,13 +134,13 @@ void BanCommand_mute(int request, int argc, string command)
                                if (accepted > 0)
                                {
                                        string theid = "";
-                                       if(!PlayerInIPList(client, autocvar_g_muteban_list))
+                                       if(!PlayerInIPList(client, autocvar_g_chatban_list))
                                                theid = cons(theid, client.netaddress);
-                                       if(!PlayerInIDList(client, autocvar_g_muteban_list))
+                                       if(!PlayerInIDList(client, autocvar_g_chatban_list))
                                                theid = cons(theid, client.crypto_idfp);
                                        CS(client).muted = true;
                                        LOG_INFO(strcat("Mute-banning player ", GetCallerName(client), " (", argv(1), ")."));
-                                       cvar_set("g_muteban_list", cons(autocvar_g_muteban_list, theid));
+                                       cvar_set("g_chatban_list", cons(autocvar_g_chatban_list, theid));
 
                                        return;
                                }
@@ -156,7 +157,7 @@ void BanCommand_mute(int request, int argc, string command)
                {
                        LOG_HELP("Usage:^3 sv_cmd mute <client>");
                        LOG_HELP("  <client> is the entity number or name of the player to mute.");
-                       LOG_HELP("See also: ^2unmute, g_muteban_list^7");
+                       LOG_HELP("See also: ^2unmute, g_chatban_list^7");
                        return;
                }
        }
@@ -183,6 +184,8 @@ void BanCommand_playban(int request, int argc, string command)
 
                                        LOG_INFO(strcat("Play-banning player ", GetCallerName(client), " (", argv(1), ")."));
                                        PutObserverInServer(client, true, true);
+                                       if (autocvar_g_playban_minigames) 
+                                               part_minigame(client);
                                        cvar_set("g_playban_list", cons(autocvar_g_playban_list, theid));
 
                                        return;
@@ -267,14 +270,14 @@ void BanCommand_unmute(int request, int argc)
                                if (accepted > 0)
                                {
                                        string tmp_string = "";
-                                       FOREACH_WORD(autocvar_g_muteban_list, it != client.netaddress,
+                                       FOREACH_WORD(autocvar_g_chatban_list, it != client.netaddress,
                                        {
                                                if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
                                                        continue;
                                                tmp_string = cons(tmp_string, it);
                                        });
 
-                                       cvar_set("g_muteban_list", tmp_string);
+                                       cvar_set("g_chatban_list", tmp_string);
                                        LOG_INFO(strcat("Unmuting player ", GetCallerName(client), " (", original_arg, ")."));
                                        CS(client).muted = false;
 
@@ -293,7 +296,7 @@ void BanCommand_unmute(int request, int argc)
                {
                        LOG_HELP("Usage:^3 sv_cmd unmute <client>");
                        LOG_HELP("  <client> is the entity number or name of the player to unmute.");
-                       LOG_HELP("See also: ^2mute, g_muteban_list^7");
+                       LOG_HELP("See also: ^2mute, g_chatban_list^7");
                        return;
                }
        }
@@ -462,16 +465,16 @@ void BanCommand_(int request)
 
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #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("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("playban", BanCommand_playban(request, arguments, command), "Force to spectate a client permanently") \
-       BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \
-       BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \
-       BAN_COMMAND("unvoteban", BanCommand_unvoteban(request, arguments), "Remove an existing voting ban") \
-       BAN_COMMAND("unplayban", BanCommand_unplayban(request, arguments), "Remove an existing forced to spectate ban") \
-       BAN_COMMAND("voteban", BanCommand_voteban(request, arguments, command), "Disallow a client from voting") \
+       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("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("playban",      BanCommand_playban(request, arguments, command),    "Force to spectate a client permanently") \
+       BAN_COMMAND("unban",        BanCommand_unban(request, arguments),               "Remove an existing ban") \
+       BAN_COMMAND("unmute",       BanCommand_unmute(request, arguments),              "Unmute a client") \
+       BAN_COMMAND("unvoteban",    BanCommand_unvoteban(request, arguments),           "Remove an existing voting ban") \
+       BAN_COMMAND("unplayban",    BanCommand_unplayban(request, arguments),           "Remove an existing forced to spectate ban") \
+       BAN_COMMAND("voteban",      BanCommand_voteban(request, arguments, command),    "Disallow a client from voting") \
        /* nothing */
 
 void BanCommand_macro_help()