]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Ladder and lockteams support
authorSamual <samual@xonotic.org>
Wed, 13 Jul 2011 01:13:51 +0000 (21:13 -0400)
committerSamual <samual@xonotic.org>
Wed, 13 Jul 2011 01:13:51 +0000 (21:13 -0400)
qcsrc/server/gamecommand.qc

index b6544f3fbaa77ccd46ceeff606905c50d4adbfbe..9e355c2609cde915a1066c6003ca60b01ae79244 100644 (file)
@@ -1309,7 +1309,7 @@ void GameCommand_gettaginfo(float request, string command) // UNTESTED // todo:
                        print("Incorrect parameters for \"gettaginfo\"\n");
                case GC_REQUEST_USAGE:
                        print("\nUsage: sv_cmd gettaginfo\n");
-                       print("  No arguments required.\n");
+                       print("  FIXME: Arguments currently unknown\n");
                        return;
        }
 }
@@ -1339,6 +1339,52 @@ void GameCommand_gotomap(float request, string command)
        }
 }
 
+void GameCommand_ladder(float request)
+{
+       switch(request)
+       {
+               case GC_REQUEST_HELP:
+                       print("  ladder - Get information about top players if supported\n");
+                       return;
+                       
+               case GC_REQUEST_COMMAND:
+                       print(ladder_reply);
+                       return;
+                       
+               default:
+               case GC_REQUEST_USAGE:
+                       print("\nUsage: sv_cmd ladder\n");
+                       print("  No arguments required.\n");
+                       return;
+       }
+}
+
+void GameCommand_lockteams(float request)
+{
+       switch(request)
+       {
+               case GC_REQUEST_HELP:
+                       print("  lockteams - Disable the ability for players to switch or enter teams\n");
+                       return;
+                       
+               case GC_REQUEST_COMMAND:
+                       if(teamplay)
+                       {
+                               lockteams = 1;
+                               bprint("^1The teams are now locked.\n");
+                       }
+                       else
+                               bprint("That command can only be used in a team-based gamemode.\n");
+                       return;
+                       
+               default:
+               case GC_REQUEST_USAGE:
+                       print("\nUsage: sv_cmd lockteams\n");
+                       print("  No arguments required.\n");
+                       return;
+       }
+}
+
 void GameCommand(string command)
 {
        // ===== TODO list =====
@@ -1375,6 +1421,8 @@ void GameCommand(string command)
                        GameCommand_gametype(GC_REQUEST_HELP, "");
                        GameCommand_gettaginfo(GC_REQUEST_HELP, "");
                        GameCommand_gotomap(GC_REQUEST_HELP, "");
+                       GameCommand_ladder(GC_REQUEST_HELP);
+                       GameCommand_lockteams(GC_REQUEST_HELP);
                        print("  teamstatus\n");
                        print("  printstats\n");
                        print("  make_mapinfo\n");
@@ -1425,6 +1473,8 @@ void GameCommand(string command)
                case "gametype": GameCommand_gametype(search_request_type, command); break;
                case "gettaginfo": GameCommand_gettaginfo(search_request_type, command); break;
                case "gotomap": GameCommand_gotomap(search_request_type, command); break;
+               case "ladder": GameCommand_ladder(search_request_type); break;
+               case "lockteams": GameCommand_lockteams(search_request_type); break;
                
                default:
                        print("Invalid command. For a list of supported commands, try sv_cmd help.\n");