]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
Initial implementation of cvar aliases, with slowmo as a starting example
[xonotic/darkplaces.git] / host_cmd.c
index 7bd22ecc4100b3a872cf621b4aa6a5fcafb7343e..9f50578adfc2b48cb6c0e81e7b265b08c0f665d6 100644 (file)
@@ -31,20 +31,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <time.h>
 
 int current_skill;
-cvar_t sv_cheats = {0, "sv_cheats", "0", "enables cheat commands in any game, and cheat impulses in dpmod"};
-cvar_t sv_adminnick = {CVAR_SAVE, "sv_adminnick", "", "nick name to use for admin messages instead of host name"};
-cvar_t sv_status_privacy = {CVAR_SAVE, "sv_status_privacy", "0", "do not show IP addresses in 'status' replies to clients"};
-cvar_t sv_status_show_qcstatus = {CVAR_SAVE, "sv_status_show_qcstatus", "0", "show the 'qcstatus' field in status replies, not the 'frags' field. Turn this on if your mod uses this field, and the 'frags' field on the other hand has no meaningful value."};
-cvar_t sv_namechangetimer = {CVAR_SAVE, "sv_namechangetimer", "5", "how often to allow name changes, in seconds (prevents people from using animated names and other tricks"};
-cvar_t rcon_password = {CVAR_PRIVATE, "rcon_password", "", "password to authenticate rcon commands; NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password; may be set to a string of the form user1:pass1 user2:pass2 user3:pass3 to allow multiple user accounts - the client then has to specify ONE of these combinations"};
-cvar_t rcon_secure = {CVAR_NQUSERINFOHACK, "rcon_secure", "0", "force secure rcon authentication (1 = time based, 2 = challenge based); NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password"};
-cvar_t rcon_secure_challengetimeout = {0, "rcon_secure_challengetimeout", "5", "challenge-based secure rcon: time out requests if no challenge came within this time interval"};
-cvar_t rcon_address = {0, "rcon_address", "", "server address to send rcon commands to (when not connected to a server)"};
-cvar_t team = {CVAR_USERINFO | CVAR_SAVE, "team", "none", "QW team (4 character limit, example: blue)"};
-cvar_t skin = {CVAR_USERINFO | CVAR_SAVE, "skin", "", "QW player skin name (example: base)"};
-cvar_t noaim = {CVAR_USERINFO | CVAR_SAVE, "noaim", "1", "QW option to disable vertical autoaim"};
-cvar_t r_fixtrans_auto = {0, "r_fixtrans_auto", "0", "automatically fixtrans textures (when set to 2, it also saves the fixed versions to a fixtrans directory)"};
-qboolean allowcheats = false;
+cvar_t sv_cheats = {CVAR_SERVER | CVAR_NOTIFY, "sv_cheats", "0", "enables cheat commands in any game, and cheat impulses in dpmod"};
+cvar_t sv_adminnick = {CVAR_SERVER | CVAR_SAVE, "sv_adminnick", "", "nick name to use for admin messages instead of host name"};
+cvar_t sv_status_privacy = {CVAR_SERVER | CVAR_SAVE, "sv_status_privacy", "0", "do not show IP addresses in 'status' replies to clients"};
+cvar_t sv_status_show_qcstatus = {CVAR_SERVER | CVAR_SAVE, "sv_status_show_qcstatus", "0", "show the 'qcstatus' field in status replies, not the 'frags' field. Turn this on if your mod uses this field, and the 'frags' field on the other hand has no meaningful value."};
+cvar_t sv_namechangetimer = {CVAR_SERVER | CVAR_SAVE, "sv_namechangetimer", "5", "how often to allow name changes, in seconds (prevents people from using animated names and other tricks"};
+cvar_t rcon_password = {CVAR_CLIENT | CVAR_SERVER | CVAR_PRIVATE, "rcon_password", "", "password to authenticate rcon commands; NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password; may be set to a string of the form user1:pass1 user2:pass2 user3:pass3 to allow multiple user accounts - the client then has to specify ONE of these combinations"};
+cvar_t rcon_secure = {CVAR_CLIENT | CVAR_SERVER | CVAR_NQUSERINFOHACK, "rcon_secure", "0", "force secure rcon authentication (1 = time based, 2 = challenge based); NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password"};
+cvar_t rcon_secure_challengetimeout = {CVAR_CLIENT, "rcon_secure_challengetimeout", "5", "challenge-based secure rcon: time out requests if no challenge came within this time interval"};
+cvar_t rcon_address = {CVAR_CLIENT, "rcon_address", "", "server address to send rcon commands to (when not connected to a server)"};
+cvar_t team = {CVAR_CLIENT | CVAR_USERINFO | CVAR_SAVE, "team", "none", "QW team (4 character limit, example: blue)"};
+cvar_t skin = {CVAR_CLIENT | CVAR_USERINFO | CVAR_SAVE, "skin", "", "QW player skin name (example: base)"};
+cvar_t noaim = {CVAR_CLIENT | CVAR_USERINFO | CVAR_SAVE, "noaim", "1", "QW option to disable vertical autoaim"};
+cvar_t r_fixtrans_auto = {CVAR_CLIENT, "r_fixtrans_auto", "0", "automatically fixtrans textures (when set to 2, it also saves the fixed versions to a fixtrans directory)"};
 
 extern qboolean host_shuttingdown;
 extern cvar_t developer_entityparsing;
@@ -107,7 +106,7 @@ static void Host_Status_f(cmd_state_t *cmd)
        for (players = 0, i = 0;i < svs.maxclients;i++)
                if (svs.clients[i].active)
                        players++;
-       print ("host:     %s\n", Cvar_VariableString ("hostname"));
+       print ("host:     %s\n", Cvar_VariableString (&cvars_all, "hostname", CVAR_SERVER));
        print ("version:  %s build %s (gamename %s)\n", gamename, buildstring, gamenetworkfiltername);
        print ("protocol: %i (%s)\n", Protocol_NumberForEnum(sv.protocol), Protocol_NameForEnum(sv.protocol));
        print ("map:      %s\n", sv.name);
@@ -152,7 +151,7 @@ static void Host_Status_f(cmd_state_t *cmd)
                if(sv_status_privacy.integer && cmd->source != src_command)
                        strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
                else
-                       strlcpy(ip, (client->netconnection && client->netconnection->address) ? client->netconnection->address : "botclient", 48);
+                       strlcpy(ip, (client->netconnection && *client->netconnection->address) ? client->netconnection->address : "botclient", 48);
 
                frags = client->frags;
 
@@ -211,9 +210,9 @@ Sets client to godmode
 static void Host_God_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
-       if (!allowcheats)
+       if (!sv_cheats.integer)
        {
-               SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+               SV_ClientPrint("No cheats allowed. Set sv_cheats to 1 in the server console to enable.\n");
                return;
        }
 
@@ -227,9 +226,9 @@ static void Host_God_f(cmd_state_t *cmd)
 static void Host_Notarget_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
-       if (!allowcheats)
+       if (!sv_cheats.integer)
        {
-               SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+               SV_ClientPrint("No cheats allowed. Set sv_cheats to 1 in the server console to enable.\n");
                return;
        }
 
@@ -245,9 +244,9 @@ qboolean noclip_anglehack;
 static void Host_Noclip_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
-       if (!allowcheats)
+       if (!sv_cheats.integer)
        {
-               SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+               SV_ClientPrint("No cheats allowed. Set sv_cheats to 1 in the server console to enable.\n");
                return;
        }
 
@@ -275,9 +274,9 @@ Sets client to flymode
 static void Host_Fly_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
-       if (!allowcheats)
+       if (!sv_cheats.integer)
        {
-               SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+               SV_ClientPrint("No cheats allowed. Set sv_cheats to 1 in the server console to enable.\n");
                return;
        }
 
@@ -331,6 +330,31 @@ static void Host_Ping_f(cmd_state_t *cmd)
        }
 }
 
+// Disable cheats if sv_cheats is turned off
+static void Host_DisableCheats_c(char *value)
+{
+       prvm_prog_t *prog = SVVM_prog;
+       int i = 0;
+
+       if (value[0] == '0' && !value[1])
+       {
+               while (svs.clients[i].edict)
+               {
+                       if (((int)PRVM_serveredictfloat(svs.clients[i].edict, flags) & FL_GODMODE))
+                               PRVM_serveredictfloat(svs.clients[i].edict, flags) = (int)PRVM_serveredictfloat(svs.clients[i].edict, flags) ^ FL_GODMODE;
+                       if (((int)PRVM_serveredictfloat(svs.clients[i].edict, flags) & FL_NOTARGET))
+                               PRVM_serveredictfloat(svs.clients[i].edict, flags) = (int)PRVM_serveredictfloat(svs.clients[i].edict, flags) ^ FL_NOTARGET;
+                       if (PRVM_serveredictfloat(svs.clients[i].edict, movetype) == MOVETYPE_NOCLIP ||
+                               PRVM_serveredictfloat(svs.clients[i].edict, movetype) == MOVETYPE_FLY)
+                       {
+                               noclip_anglehack = false;
+                               PRVM_serveredictfloat(svs.clients[i].edict, movetype) = MOVETYPE_WALK;
+                       }
+                       i++;
+               }
+       }
+}
+
 /*
 ===============================================================================
 
@@ -360,7 +384,7 @@ static void Host_Map_f(cmd_state_t *cmd)
 
        // GAME_DELUXEQUAKE - clear warpmark (used by QC)
        if (gamemode == GAME_DELUXEQUAKE)
-               Cvar_Set("warpmark", "");
+               Cvar_Set(&cvars_all, "warpmark", "");
 
        cls.demonum = -1;               // stop demo loop in case this fails
 
@@ -383,7 +407,6 @@ static void Host_Map_f(cmd_state_t *cmd)
        key_dest = key_game;
 
        svs.serverflags = 0;                    // haven't completed an episode yet
-       allowcheats = sv_cheats.integer != 0;
        strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
        SV_SpawnServer(level);
        if (sv.active && cls.state == ca_disconnected)
@@ -420,7 +443,6 @@ static void Host_Changelevel_f(cmd_state_t *cmd)
        key_dest = key_game;
 
        SV_SaveSpawnparms ();
-       allowcheats = sv_cheats.integer != 0;
        strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
        SV_SpawnServer(level);
        if (sv.active && cls.state == ca_disconnected)
@@ -456,7 +478,6 @@ static void Host_Restart_f(cmd_state_t *cmd)
 #endif
        key_dest = key_game;
 
-       allowcheats = sv_cheats.integer != 0;
        strlcpy(mapname, sv.name, sizeof(mapname));
        SV_SpawnServer(mapname);
        if (sv.active && cls.state == ca_disconnected)
@@ -495,9 +516,9 @@ void Host_Reconnect_f(cmd_state_t *cmd)
 
                S_StopAllSounds();
 
-               if (cls.state == ca_connected && cls.signon < SIGNONS)
+               if (cls.state == ca_connected)
                {
-                       Con_Printf("reconnecting...\n");
+                       Con_Printf("Server is changing level...\n");
                        MSG_WriteChar(&cls.netcon->message, qw_clc_stringcmd);
                        MSG_WriteString(&cls.netcon->message, "new");
                }
@@ -730,7 +751,7 @@ static void Host_Savegame_f(cmd_state_t *cmd)
                }
        }
        else
-               Con_Print("Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
+               Con_Warn("Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
 
        if (Cmd_Argc(cmd) != 2)
        {
@@ -833,7 +854,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
        COM_ParseToken_Simple(&t, false, false, true);
 // this silliness is so we can load 1.06 save files, which have float skill values
        current_skill = (int)(atof(com_token) + 0.5);
-       Cvar_SetValue ("skill", (float)current_skill);
+       Cvar_SetValue (&cvars_all, "skill", (float)current_skill);
 
        if(developer_entityparsing.integer)
                Con_Printf("Host_Loadgame_f: loading mapname\n");
@@ -849,8 +870,6 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
        COM_ParseToken_Simple(&t, false, false, true);
        time = atof(com_token);
 
-       allowcheats = sv_cheats.integer != 0;
-
        if(developer_entityparsing.integer)
                Con_Printf("Host_Loadgame_f: spawning server\n");
 
@@ -937,7 +956,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
                        PRVM_ED_ParseGlobals (prog, start);
 
                        // restore the autocvar globals
-                       Cvar_UpdateAllAutoCvars();
+                       Cvar_UpdateAllAutoCvars(prog->console_cmd->cvars);
                }
                else
                {
@@ -959,7 +978,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
                        PRVM_ED_ParseEdict (prog, start, ent);
 
                        // link it into the bsp tree
-                       if (!ent->priv.server->free)
+                       if (!ent->priv.server->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
                                SV_LinkEdict(ent);
                }
 
@@ -1041,7 +1060,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
                                                        if (COM_ParseToken_Simple(&t, false, false, true))
                                                                k |= atoi(com_token);
                                                        if (!BufStr_FindCreateReplace(prog, i, k, "string"))
-                                                               Con_Printf("failed to create stringbuffer %i\n", i);
+                                                               Con_Errorf("failed to create stringbuffer %i\n", i);
                                                }
                                                else
                                                        Con_Printf("unsupported stringbuffer index %i \"%s\"\n", i, com_token);
@@ -1071,7 +1090,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
                                                                Con_Printf("unexpected end of line when parsing sv.bufstr (expected strindex)\n");
                                                }
                                                else
-                                                       Con_Printf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
+                                                       Con_Errorf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
                                        }
                                }       
                                // skip any trailing text or unrecognized commands
@@ -1106,7 +1125,7 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
 Host_Name_f
 ======================
 */
-cvar_t cl_name = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_name", "player", "internal storage cvar for current player name (changed by name command)"};
+cvar_t cl_name = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_name", "player", "internal storage cvar for current player name (changed by name command)"};
 static void Host_Name_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
@@ -1133,7 +1152,7 @@ static void Host_Name_f(cmd_state_t *cmd)
 
        if (cmd->source == src_command)
        {
-               Cvar_Set ("_cl_name", newName);
+               Cvar_Set (&cvars_all, "_cl_name", newName);
                if (strlen(newNameSource) >= sizeof(newName)) // overflowed
                {
                        Con_Printf("Your name is longer than %i chars! It has been truncated.\n", (int) (sizeof(newName) - 1));
@@ -1237,7 +1256,7 @@ static void Host_Name_f(cmd_state_t *cmd)
 Host_Playermodel_f
 ======================
 */
-cvar_t cl_playermodel = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playermodel", "", "internal storage cvar for current player model in Nexuiz/Xonotic (changed by playermodel command)"};
+cvar_t cl_playermodel = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playermodel", "", "internal storage cvar for current player model in Nexuiz/Xonotic (changed by playermodel command)"};
 // the old cl_playermodel in cl_main has been renamed to __cl_playermodel
 static void Host_Playermodel_f(cmd_state_t *cmd)
 {
@@ -1266,7 +1285,7 @@ static void Host_Playermodel_f(cmd_state_t *cmd)
 
        if (cmd->source == src_command)
        {
-               Cvar_Set ("_cl_playermodel", newPath);
+               Cvar_Set (&cvars_all, "_cl_playermodel", newPath);
                return;
        }
 
@@ -1298,7 +1317,7 @@ static void Host_Playermodel_f(cmd_state_t *cmd)
 Host_Playerskin_f
 ======================
 */
-cvar_t cl_playerskin = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playerskin", "", "internal storage cvar for current player skin in Nexuiz/Xonotic (changed by playerskin command)"};
+cvar_t cl_playerskin = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playerskin", "", "internal storage cvar for current player skin in Nexuiz/Xonotic (changed by playerskin command)"};
 static void Host_Playerskin_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
@@ -1326,7 +1345,7 @@ static void Host_Playerskin_f(cmd_state_t *cmd)
 
        if (cmd->source == src_command)
        {
-               Cvar_Set ("_cl_playerskin", newPath);
+               Cvar_Set (&cvars_all, "_cl_playerskin", newPath);
                return;
        }
 
@@ -1575,7 +1594,7 @@ static void Host_Tell_f(cmd_state_t *cmd)
 Host_Color_f
 ==================
 */
-cvar_t cl_color = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};
+cvar_t cl_color = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};
 static void Host_Color(cmd_state_t *cmd, int changetop, int changebottom)
 {
        prvm_prog_t *prog = SVVM_prog;
@@ -1686,8 +1705,8 @@ static void Host_BottomColor_f(cmd_state_t *cmd)
        Host_Color(cmd, -1, atoi(Cmd_Argv(cmd, 1)));
 }
 
-cvar_t cl_rate = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_rate", "20000", "internal storage cvar for current rate (changed by rate command)"};
-cvar_t cl_rate_burstsize = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_rate_burstsize", "1024", "internal storage cvar for current rate control burst size (changed by rate_burstsize command)"};
+cvar_t cl_rate = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_rate", "20000", "internal storage cvar for current rate (changed by rate command)"};
+cvar_t cl_rate_burstsize = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_rate_burstsize", "1024", "internal storage cvar for current rate control burst size (changed by rate_burstsize command)"};
 static void Host_Rate_f(cmd_state_t *cmd)
 {
        int rate;
@@ -1706,7 +1725,7 @@ static void Host_Rate_f(cmd_state_t *cmd)
 
        if (cmd->source == src_command)
        {
-               Cvar_SetValue ("_cl_rate", max(NET_MINRATE, rate));
+               Cvar_SetValue (&cvars_all, "_cl_rate", max(NET_MINRATE, rate));
                return;
        }
 
@@ -1727,7 +1746,7 @@ static void Host_Rate_BurstSize_f(cmd_state_t *cmd)
 
        if (cmd->source == src_command)
        {
-               Cvar_SetValue ("_cl_rate_burstsize", rate_burstsize);
+               Cvar_SetValue (&cvars_all, "_cl_rate_burstsize", rate_burstsize);
                return;
        }
 
@@ -1806,7 +1825,7 @@ LadyHavoc: only supported for Nehahra, I personally think this is dumb, but Mind
 LadyHavoc: correction, Mindcrime will be removing pmodel in the future, but it's still stuck here for compatibility.
 ======================
 */
-cvar_t cl_pmodel = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_pmodel", "0", "internal storage cvar for current player model number in nehahra (changed by pmodel command)"};
+cvar_t cl_pmodel = {CVAR_CLIENT | CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_pmodel", "0", "internal storage cvar for current player model number in nehahra (changed by pmodel command)"};
 static void Host_PModel_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
@@ -1826,7 +1845,7 @@ static void Host_PModel_f(cmd_state_t *cmd)
        {
                if (cl_pmodel.integer == i)
                        return;
-               Cvar_SetValue ("_cl_pmodel", i);
+               Cvar_SetValue (&cvars_all, "_cl_pmodel", i);
                if (cls.state == ca_connected)
                        Cmd_ForwardToServer_f(cmd);
                return;
@@ -2141,7 +2160,7 @@ static void Host_Give_f(cmd_state_t *cmd)
        const char *t;
        int v;
 
-       if (!allowcheats)
+       if (!sv_cheats.integer)
        {
                SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
                return;
@@ -2483,13 +2502,13 @@ static void Host_SendCvar_f(cmd_state_t *cmd)
        cvarname = Cmd_Argv(cmd, 1);
        if (cls.state == ca_connected)
        {
-               c = Cvar_FindVar(cvarname);
+               c = Cvar_FindVar(&cvars_all, cvarname, CVAR_CLIENT | CVAR_SERVER, false);
                // LadyHavoc: if there is no such cvar or if it is private, send a
                // reply indicating that it has no value
                if(!c || (c->flags & CVAR_PRIVATE))
                        Cmd_ForwardStringToServer(va(vabuf, sizeof(vabuf), "sentcvar %s", cvarname));
                else
-                       Cmd_ForwardStringToServer(va(vabuf, sizeof(vabuf), "sentcvar %s \"%s\"", c->name, c->string));
+                       Cmd_ForwardStringToServer(va(vabuf, sizeof(vabuf), "sentcvar %s \"%s\"", cvarname, c->string));
                return;
        }
        if(!sv.active)// || !PRVM_serverfunction(SV_ParseClientCommand))
@@ -2531,9 +2550,9 @@ static void MaxPlayers_f(cmd_state_t *cmd)
 
        svs.maxclients_next = n;
        if (n == 1)
-               Cvar_Set ("deathmatch", "0");
+               Cvar_Set (&cvars_all, "deathmatch", "0");
        else
-               Cvar_Set ("deathmatch", "1");
+               Cvar_Set (&cvars_all, "deathmatch", "1");
 }
 
 /*
@@ -2929,7 +2948,7 @@ Host_Pings_f
 Send back ping and packet loss update for all current players to this player
 ====================
 */
-void Host_Pings_f(cmd_state_t *cmd)
+static void Host_Pings_f(cmd_state_t *cmd)
 {
        int             i, j, ping, packetloss, movementloss;
        char temp[128];
@@ -3026,6 +3045,7 @@ void Host_InitCommands (void)
        Cvar_RegisterVariable(&skin);
        Cvar_RegisterVariable(&noaim);
        Cvar_RegisterVariable(&sv_cheats);
+       Cvar_RegisterCallback(&sv_cheats, Host_DisableCheats_c);
        Cvar_RegisterVariable(&sv_adminnick);
        Cvar_RegisterVariable(&sv_status_privacy);
        Cvar_RegisterVariable(&sv_status_show_qcstatus);
@@ -3102,22 +3122,17 @@ void Host_InitCommands (void)
        Cmd_AddCommand(&cmd_serverfromclient, "playerskin", Host_Playerskin_f, "change your player skin number");
 
        // client commands that require a connection and are simply forwarded to server
-       Cmd_AddCommand(&cmd_client, "status", Cmd_ForwardToServer_f, "print server status information");
        Cmd_AddCommand(&cmd_client, "god", Cmd_ForwardToServer_f, "god mode (invulnerability)");
        Cmd_AddCommand(&cmd_client, "notarget", Cmd_ForwardToServer_f, "notarget mode (monsters do not see you)");
        Cmd_AddCommand(&cmd_client, "fly", Cmd_ForwardToServer_f, "fly mode (flight)");
        Cmd_AddCommand(&cmd_client, "noclip", Cmd_ForwardToServer_f, "noclip mode (flight without collisions, move through walls)");
        Cmd_AddCommand(&cmd_client, "give", Cmd_ForwardToServer_f, "alter inventory");
-       Cmd_AddCommand(&cmd_client, "say", Cmd_ForwardToServer_f, "send a chat message to everyone on the server");
        Cmd_AddCommand(&cmd_client, "say_team", Cmd_ForwardToServer_f, "send a chat message to your team on the server");
-       Cmd_AddCommand(&cmd_client, "tell", Cmd_ForwardToServer_f, "send a chat message to only one person on the server");
        Cmd_AddCommand(&cmd_client, "kill", Cmd_ForwardToServer_f, "die instantly");
-       Cmd_AddCommand(&cmd_client, "pause", Cmd_ForwardToServer_f, "pause the game (if the server allows pausing)");
-       Cmd_AddCommand(&cmd_client, "ping", Cmd_ForwardToServer_f, "print ping times of all players on the server");
 
        Cmd_AddCommand(&cmd_client, "connect", Host_Connect_f, "connect to a server by IP address or hostname");
        Cmd_AddCommand(&cmd_client, "reconnect", Host_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
-       Cmd_AddCommand(&cmd_client, "version", Host_Version_f, "print engine version");
+       Cmd_AddCommand(&cmd_clientfromserver, "reconnect", Host_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
        Cmd_AddCommand(&cmd_client, "startdemos", Host_Startdemos_f, "start playing back the selected demos sequentially (used at end of startup script)");
        Cmd_AddCommand(&cmd_client, "demos", Host_Demos_f, "restart looping demos defined by the last startdemos command");
        Cmd_AddCommand(&cmd_client, "stopdemo", Host_Stopdemo_f, "stop playing or recording demo (like stop command) and return to looping demos");
@@ -3128,6 +3143,7 @@ void Host_InitCommands (void)
        Cmd_AddCommand(&cmd_client, "fullinfo", Host_FullInfo_f, "allows client to modify their userinfo");
        Cmd_AddCommand(&cmd_client, "setinfo", Host_SetInfo_f, "modifies your userinfo");
        Cmd_AddCommand(&cmd_client, "packet", Host_Packet_f, "send a packet to the specified address:port containing a text string");
+       Cmd_AddCommand(&cmd_clientfromserver, "packet", Host_Packet_f, "send a packet to the specified address:port containing a text string");
        Cmd_AddCommand(&cmd_client, "topcolor", Host_TopColor_f, "QW command to set top color without changing bottom color");
        Cmd_AddCommand(&cmd_client, "bottomcolor", Host_BottomColor_f, "QW command to set bottom color without changing top color");
        Cmd_AddCommand(&cmd_client, "fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)");