]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Merge branch 'master' into z411/bai-server
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 9feb068a812bdd377f7bf9a6822cdf0217a52104..0c1dcc79844919aaa709a828dfb90d1efddbe236 100644 (file)
@@ -275,7 +275,7 @@ void ClientCommand_join(entity caller, int request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if (!game_stopped && IS_CLIENT(caller) && !IS_PLAYER(caller))
+                       if (!game_stopped && !game_timeout && IS_CLIENT(caller) && !IS_PLAYER(caller))
                        {
                                if (joinAllowed(caller))
                                        Join(caller);
@@ -382,13 +382,13 @@ void ClientCommand_ready(entity caller, int request)
                                        {
                                                caller.ready = false;
                                                if (IS_PLAYER(caller) || INGAME_JOINED(caller))
-                                                       bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
+                                                       bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
                                        }
                                        else
                                        {
                                                caller.ready = true;
                                                if (IS_PLAYER(caller) || INGAME_JOINED(caller))
-                                                       bprint(playername(caller.netname, caller.team, false), "^2 is ready\n");
+                                                       bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ready\n");
                                        }
 
                                        caller.last_ready = time;
@@ -595,7 +595,7 @@ void ClientCommand_spectate(entity caller, int request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if (!intermission_running && IS_CLIENT(caller))
+                       if (!intermission_running && IS_CLIENT(caller) && !game_timeout)
                        {
                                if(argv(1) != "")
                                {
@@ -639,6 +639,25 @@ void ClientCommand_spectate(entity caller, int request)
        }
 }
 
+void ClientCommand_sounds(entity caller, int request)
+{
+       switch (request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       sprint(caller, strcat("Available sounds: \n\n", autocvar_sv_chat_sounds_list, "\n"));
+                       return; // never fall through to usage
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       sprint(caller, "\nUsage:^3 cmd sounds\n");
+                       return;
+               }
+       }
+}
+
 void ClientCommand_suggestmap(entity caller, int request, int argc)
 {
        switch (request)
@@ -812,6 +831,7 @@ void ClientCommand_(entity caller, int request)
        CLIENT_COMMAND("selfstuff", ClientCommand_selfstuff(ent, request, command), "Stuffcmd a command to your own client") \
        CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments), "New system for sending a client cvar to the server") \
        CLIENT_COMMAND("spectate", ClientCommand_spectate(ent, request), "Become an observer") \
+       CLIENT_COMMAND("sounds", ClientCommand_sounds(ent, request), "Get list of commsnds") \
        CLIENT_COMMAND("suggestmap", ClientCommand_suggestmap(ent, request, arguments), "Suggest a map to the mapvote at match end") \
        CLIENT_COMMAND("tell", ClientCommand_tell(ent, request, arguments, command), "Send a message directly to a player") \
        CLIENT_COMMAND("voice", ClientCommand_voice(ent, request, arguments, command), "Send voice message via sound") \