]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/clientcommands.qc
Merge remote branch 'origin/master' into samual/updatecommands
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / clientcommands.qc
index fe9ef8e6b72e92f33704ee8055b19b55426adb8f..8770f11f715e24bcd9142b19199ec32055afc37b 100644 (file)
@@ -1,28 +1,65 @@
 // =======================================================
 //  Server side client commands code, reworked by Samual
-//  Last updated: July 22nd, 2011
+//  Last updated: July 24th, 2011
 // =======================================================
 
 #define CC_REQUEST_HELP 1
 #define CC_REQUEST_COMMAND 2
 #define CC_REQUEST_USAGE 3
 
-float readyrestart_happened;
 entity nagger;
+
+.float cmd_floodtime;
+.float cmd_floodcount;
+.float checkfail;
+
+float readyrestart_happened;
 float readycount;
-void ReadyCount();
+
 string MapVote_Suggest(string m);
 
+void ReadyCount();
+
+
 // ============================
 //  Misc. Supporting Functions
 // ============================
 
+float SV_ParseClientCommand_floodcheck()
+{
+       if (timeoutStatus != 2) // if the game is not paused... but wait, doesn't that mean it could be dos'd by pausing it? eh? (old code)
+       {
+               if(time == self.cmd_floodtime) // todo: add buffer time as well, ONLY one second is a short amount of time for someone to be spamming. 
+               {
+                       self.cmd_floodcount += 1;
+                       if(self.cmd_floodcount > 8) // todo: replace constant 8 with a cvar for the server to control
+                               return FALSE; // too much spam, halt
+               }
+               else
+               {
+                       self.cmd_floodtime = time;
+                       self.cmd_floodcount = 1;
+               }
+       }
+       return TRUE; // continue, as we're not flooding yet
+}
+
 float Nagger_SendEntity(entity to, float sendflags)
 {
        float nags, i, f, b;
        entity e;
        WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
 
+       // bits:
+       //   1 = ready
+       //   2 = player needs to ready up
+       //   4 = vote
+       //   8 = player needs to vote
+       //  16 = warmup
+       // sendflags:
+       //  64 = vote counts
+       // 128 = vote string
+
        nags = 0;
        if(readycount)
        {
@@ -39,19 +76,28 @@ float Nagger_SendEntity(entity to, float sendflags)
        if(inWarmupStage)
                nags |= 16;
 
+       if(sendflags & 64)
+               nags |= 64;
+
        if(sendflags & 128)
                nags |= 128;
 
        if(!(nags & 4)) // no vote called? send no string
-               nags &~= 128;
+               nags &~= (64 | 128);
 
        WriteByte(MSG_ENTITY, nags);
 
-       if(nags & 128)
+       if(nags & 64)
        {
-               WriteString(MSG_ENTITY, votecalledvote_display);
+               WriteByte(MSG_ENTITY, vote_yescount);
+               WriteByte(MSG_ENTITY, vote_nocount);
+               WriteByte(MSG_ENTITY, vote_needed_absolute);
+               WriteChar(MSG_ENTITY, to.vote_vote);
        }
 
+       if(nags & 128)
+               WriteString(MSG_ENTITY, votecalledvote_display);
+
        if(nags & 1)
        {
                for(i = 1; i <= maxclients; i += 8)
@@ -77,7 +123,7 @@ void Nagger_VoteChanged()
 void Nagger_VoteCountChanged()
 {
        if(nagger)
-               nagger.SendFlags |= 1;
+               nagger.SendFlags |= 64;
 }
 void Nagger_ReadyCounted()
 {
@@ -299,105 +345,521 @@ void ClientCommand_autoswitch(float request, entity client, float argc)
        switch(request)
        {
                case CC_REQUEST_HELP:
-                       print("  ^2autoswitch^7: Whether or not to switch automatically when getting a better weapon\n");
+                       sprint(client, "  ^2autoswitch^7: Whether or not to switch automatically when getting a better weapon\n");
                        return;
                        
                case CC_REQUEST_COMMAND:
                        client.autoswitch = ("0" != argv(1));
-                       sprint(client, strcat("^1autoswitch has been turned ", (client.autoswitch ? "on" : "off"), ".\n"));
+                       sprint(client, strcat("^1autoswitch is currently turned ", (client.autoswitch ? "on" : "off"), ".\n"));
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd autoswitch selection\n");
+                       sprint(client, "  Where 'selection' is 1 or 0 for on or off.\n"); 
+                       return;
+       }
+}
+
+void ClientCommand_checkfail(float request, entity client, string command) // used only by client side code
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2checkfail^7: Report if a client-side check failed\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       print(sprintf("CHECKFAIL: %s (%s) epically failed check %s\n", client.netname, client.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))));
+                       client.checkfail = 1;
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd checkfail message\n");
+                       sprint(client, "  Where 'message' is the message reported by client about the fail.\n");
+                       return;
+       }
+}
+
+void ClientCommand_clientversion(float request, entity client, float argc) // used only by client side code
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2clientversion^7: Release version of the game\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       if(client.flags & FL_CLIENT)
+                       {
+                               client.version = ((argv(1) == "$gameversion") ? 1 : stof(argv(1)));
+                               
+                               if(client.version < autocvar_gameversion_min || client.version > autocvar_gameversion_max)
+                               {
+                                       client.version_mismatch = 1;
+                                       ClientKill_TeamChange(-2); // observe
+                               } 
+                               else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) 
+                               {
+                                       //JoinBestTeam(self, FALSE, TRUE);
+                               } 
+                               else if(teamplay && !autocvar_sv_spectate && !(client.team_forced > 0)) 
+                               {
+                                       client.classname = "observer"; // really?
+                                       stuffcmd(client, "menu_showteamselect\n");
+                               }
+                       }
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd clientversion version\n");
+                       sprint(client, "  Where 'version' is the game version reported by client.\n");
+                       return;
+       }
+}
+
+void ClientCommand_cvar_changes(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2cvar_changes^7: Prints a list of all changed server cvars\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, cvar_changes);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 sv_cmd cvar_changes\n");
+                       sprint(client, "  No arguments required.\n");
+                       //sprint(client, "See also: ^2cvar_purechanges^7\n");
+                       return;
+       }
+}
+
+void ClientCommand_cvar_purechanges(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2cvar_purechanges^7: Prints a list of all changed gameplay cvars\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, cvar_purechanges);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 sv_cmd cvar_purechanges\n");
+                       sprint(client, "  No arguments required.\n");
+                       //sprint(client, "See also: ^2cvar_changes^7\n");
+                       return;
+       }
+}
+
+void ClientCommand_info(float request, entity client, float argc)
+{
+       string command;
+       
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2info^7: Request for unique server information set up by admin\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       command = cvar_string_builtin(strcat("sv_info_", argv(1))); 
+                       if(command)
+                               wordwrap_sprint(command, 1111); // why 1111?
+                       else
+                               sprint(client, "ERROR: unsupported info command\n");
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd info request\n");
+                       sprint(client, "  Where 'request' is the suffixed string appended onto the request for cvar.\n");
+                       return;
+       }
+}
+
+void ClientCommand_join(float request, entity client)
+{
+       entity oldself;
+
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2join^7: Become a player in the game\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       if(client.flags & FL_CLIENT)
+                       {
+                               if(client.classname != "player" && !lockteams && !g_arena)
+                               {
+                                       if(nJoinAllowed(1)) 
+                                       {
+                                               oldself = self;
+                                               self = client;
+                                               if(g_ca) { client.caplayer = 1; }
+                                               if(autocvar_g_campaign) { campaign_bots_may_start = 1; }
+                                               
+                                               client.classname = "player";
+                                               PlayerScore_Clear(client);
+                                               bprint ("^4", client.netname, "^4 is playing now\n");
+                                               PutClientInServer();
+                                               self = oldself;
+                                       }
+                                       else 
+                                       {
+                                               //player may not join because of g_maxplayers is set
+                                               centerprint_atprio(client, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
+                                       }
+                               }
+                       }
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd join\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_ladder(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2ladder^7: Get information about top players if supported\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, ladder_reply);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd ladder\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_lsmaps(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2lsmaps^7: List maps which can be used with the current game mode\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, lsmaps_reply);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd lsmaps\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_lsnewmaps(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2lsnewmaps^7: List maps which TODO\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, lsnewmaps_reply);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd lsnewmaps\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_maplist(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2maplist^7: Full server maplist reply\n");
                        return;
                        
+               case CC_REQUEST_COMMAND:
+                       sprint(client, maplist_reply);
+                       return; // never fall through to usage
+                       
                default:
                case CC_REQUEST_USAGE:
-                       print("\nUsage:^3 cl_cmd autoswitch\n");
-                       print("  No arguments required.\n");
+                       sprint(client, "\nUsage:^3 cmd maplist\n");
+                       sprint(client, "  No arguments required.\n");
                        return;
        }
 }
 
+void ClientCommand_rankings(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2rankings^7: Print information about rankings\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       sprint(client, rankings_reply);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd rankings\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
 
-// =========================================
-//  Main Function Called By Engine (cl_cmd)
-// =========================================
-// If this function exists, game code handles clientcommand instead of the engine code.
+void ClientCommand_ready(float request, entity client) // TODO: reimplement how this works
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2ready^7: Qualify as ready to end warmup stage (or restart server if allowed)\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       if(client.flags & FL_CLIENT)
+                       {
+                               if(inWarmupStage || autocvar_sv_ready_restart || g_race_qualifying == 2)
+                               {
+                                       if(!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
+                                       {
+                                               if (client.ready) // toggle
+                                               {
+                                                       client.ready = FALSE;
+                                                       bprint(client.netname, "^2 is ^1NOT^2 ready\n");
+                                               }
+                                               else
+                                               {
+                                                       client.ready = TRUE;
+                                                       bprint(client.netname, "^2 is ready\n");
+                                               }
+
+                                               // cannot reset the game while a timeout is active!
+                                               if(!timeoutStatus)
+                                                       ReadyCount();
+                                       } else {
+                                               sprint(client, "^1Game has already been restarted\n");
+                                       }
+                               }
+                       }
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd ready\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_records(float request, entity client)
+{
+       float i;
+       
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2records^7: List top 10 records for the current map\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       for(i = 0; i < 10; ++i)
+                               sprint(client, records_reply[i]);
+                       return; // never fall through to usage
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd records\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_reportcvar(float request, entity client, string command)
+{
+       float tokens;
+       string s;
+       
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2reportcvar^7: Old system for sending a client cvar to the server\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then
+                       {
+                               s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
+                               tokens = tokenize_console(s);
+                       }
+                       GetCvars(1);
+                       return;
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd reportcvar\n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+/*
+void ClientCommand_(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2blah^7: foobar\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       
+                       return;
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd \n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+
+void ClientCommand_(float request, entity client)
+{
+       switch(request)
+       {
+               case CC_REQUEST_HELP:
+                       sprint(client, "  ^2blah^7: foobar\n");
+                       return;
+                       
+               case CC_REQUEST_COMMAND:
+                       
+                       return;
+                       
+               default:
+               case CC_REQUEST_USAGE:
+                       sprint(client, "\nUsage:^3 cmd \n");
+                       sprint(client, "  No arguments required.\n");
+                       return;
+       }
+}
+*/
+
+
+// ======================================
+//  Main Function Called By Engine (cmd)
+// ======================================
+// If this function exists, server game code parses clientcommand before the engine code gets it.
 
 void SV_ParseClientCommand(string command)
 {
        float search_request_type;
        float argc = tokenize_console(command);
-
+       
+       // for floodcheck
+       switch(strtolower(argv(0)))
+       {
+               // exempt commands which are not subject to floodcheck
+               case "begin": break; // handled by engine in host_cmd.c
+               case "pause": break; // handled by engine in host_cmd.c
+               case "prespawn": break; // handled by engine in host_cmd.c
+               case "reportcvar": break; // handled by server in this file
+               case "sentcvar": break; // handled by server in this file
+               case "spawn": break; // handled by engine in host_cmd.c
+               
+               default: 
+                       if(SV_ParseClientCommand_floodcheck())
+                               break; // "TRUE": continue, as we're not flooding yet
+                       else
+                               return; // "FALSE": not allowed to continue, halt
+       }
+       
+       /* NOTE: totally disabled for now, however the functionality and descriptions are there if we ever want it.
        if(argv(0) == "help") 
        {
                if(argc == 1) 
                {
-                       print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are:\n");
-                       ClientCommand_autoswitch(CC_REQUEST_HELP, world, 0);
-                       print("For help about specific commands, type cl_cmd help COMMAND\n");
+                       sprint(self, "\nUsage:^3 cmd COMMAND...^7, where possible commands are:\n");
+                       ClientCommand_autoswitch(CC_REQUEST_HELP, self, 0);
+                       ClientCommand_checkfail(CC_REQUEST_HELP, self, "");
+                       ClientCommand_clientversion(CC_REQUEST_HELP, self, 0);
+                       ClientCommand_cvar_changes(CC_REQUEST_HELP, self);
+                       ClientCommand_cvar_purechanges(CC_REQUEST_HELP, self);
+                       ClientCommand_info(CC_REQUEST_HELP, self, 0);
+                       ClientCommand_join(CC_REQUEST_HELP, self); 
+                       ClientCommand_ladder(CC_REQUEST_HELP, self);
+                       ClientCommand_lsmaps(CC_REQUEST_HELP, self);
+                       ClientCommand_lsnewmaps(CC_REQUEST_HELP, self);
+                       ClientCommand_maplist(CC_REQUEST_HELP, self);
+                       ClientCommand_rankings(CC_REQUEST_HELP, self);
+                       ClientCommand_ready(CC_REQUEST_HELP, self);
+                       ClientCommand_records(CC_REQUEST_HELP, self);
+                       sprint(self, "For help about specific commands, type cmd help COMMAND\n");
                        return;
                } 
                else
                        search_request_type = CC_REQUEST_USAGE; // Instead of trying to call a command, we're going to see detailed information about it
        } 
-       /*else if(GameCommand_Vote(command, world)) 
+       else*/ if(GameCommand_Vote(command, self)) 
        {
                return; // handled by server/vote.qc 
        }
-       else if(GameCommand_Ban(command)) 
+       else if(GameCommand_MapVote(argv(0))) 
        {
-               return; // handled by server/ipban.qc
+               return; // handled by server/g_world.qc
        }
-       else if(GameCommand_Generic(command)) 
+       else if(CheatCommand(argc)) 
        {
-               return; // handled by common/gamecommand.qc
-       }*/
+               return; // handled by server/cheats.qc
+       }
        else
                search_request_type = CC_REQUEST_COMMAND; // continue as usual and scan for normal commands
-               
-       switch( ((argv(0) == "help") ? argv(1) : argv(0)) ) // if first argument is help, then search for the second argument. Else, search for first. 
+       
+       switch(strtolower((search_request_type == CC_REQUEST_USAGE) ? argv(1) : argv(0)))
        {
                // Do not hard code aliases for these, instead create them in defaultXonotic.cfg
                // also: keep in alphabetical order, please ;)
                
                case "autoswitch": ClientCommand_autoswitch(search_request_type, self, argc); break;
-               /* case "adminmsg": GameCommand_adminmsg(search_request_type, argc); break;
-               case "allready": GameCommand_allready(search_request_type); break;
-               case "allspec": GameCommand_allspec(search_request_type, argc); break;
-               case "anticheat": GameCommand_anticheat(search_request_type, argc); break;
-               case "bbox": GameCommand_bbox(search_request_type); break;
-               case "bot_cmd": GameCommand_bot_cmd(search_request_type, argc); break;
-               case "cointoss": GameCommand_cointoss(search_request_type, argc); break; 
-               case "cvar_changes": GameCommand_cvar_changes(search_request_type); break; 
-               case "cvar_purechanges": GameCommand_cvar_purechanges(search_request_type); break; 
-               case "database": GameCommand_database(search_request_type, argc); break;
-               case "defer_clear": GameCommand_defer_clear(search_request_type, argc); break;
-               case "defer_clear_all": GameCommand_defer_clear_all(search_request_type); break;
-               case "delrec": GameCommand_delrec(search_request_type, argc); break;
-               case "effectindexdump": GameCommand_effectindexdump(search_request_type); break;
-               case "extendmatchtime": GameCommand_extendmatchtime(search_request_type); break;
-               case "find": GameCommand_find(search_request_type, argc); break; 
-               case "gametype": GameCommand_gametype(search_request_type, argc); break;
-               case "gettaginfo": GameCommand_gettaginfo(search_request_type, argc); break;
-               case "gotomap": GameCommand_gotomap(search_request_type, argc); break;
-               case "ladder": GameCommand_ladder(search_request_type); break;
-               case "lockteams": GameCommand_lockteams(search_request_type); break;
-               case "make_mapinfo": GameCommand_make_mapinfo(search_request_type); break;
-               case "modelbug": GameCommand_modelbug(search_request_type); break;
-               case "moveplayer": GameCommand_moveplayer(search_request_type, argc); break;
-               case "nospectators": GameCommand_nospectators(search_request_type); break;
-               case "onslaught_updatelinks": GameCommand_onslaught_updatelinks(search_request_type); break;
-               case "playerdemo": GameCommand_playerdemo(search_request_type, argc); break;
-               case "printstats": GameCommand_printstats(search_request_type); break;
-               case "radarmap": GameCommand_radarmap(search_request_type, argc); break;
-               case "rankings": GameCommand_rankings(search_request_type); break;
-               case "records": GameCommand_records(search_request_type); break;
-               case "reducematchtime": GameCommand_reducematchtime(search_request_type); break;
-               case "stuffto": GameCommand_stuffto(search_request_type, argc); break;
-               case "teamstatus": GameCommand_teamstatus(search_request_type); break;
-               case "time": GameCommand_time(search_request_type); break;
-               case "trace": GameCommand_trace(search_request_type, argc); break;
-               case "unlockteams": GameCommand_unlockteams(search_request_type); break; */
+               case "checkfail": ClientCommand_checkfail(search_request_type, self, command); break;
+               case "clientversion": ClientCommand_clientversion(search_request_type, self, argc); break;
+               case "cvar_changes": ClientCommand_cvar_changes(search_request_type, self); break;
+               case "cvar_purechanges": ClientCommand_cvar_purechanges(search_request_type, self); break;
+               case "info": ClientCommand_info(search_request_type, self, argc); break;
+               case "join": ClientCommand_join(search_request_type, self); break;
+               case "ladder": ClientCommand_ladder(search_request_type, self); break;
+               case "lsmaps": ClientCommand_lsmaps(search_request_type, self); break;
+               case "lsnewmaps": ClientCommand_lsnewmaps(search_request_type, self); break;
+               case "maplist": ClientCommand_maplist(search_request_type, self); break;
+               case "rankings": ClientCommand_rankings(search_request_type, self); break;
+               case "ready": ClientCommand_ready(search_request_type, self); break;
+               case "records": ClientCommand_records(search_request_type, self); break;
                
                default:
-                       print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
+                       clientcommand(self, command); //print("Invalid command. For a list of supported commands, try cmd help.\n");
        }
-}
\ No newline at end of file
+}