]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
(Round 3) Break up host_cmd.c
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jun 2020 15:36:12 +0000 (15:36 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jun 2020 15:36:12 +0000 (15:36 +0000)
The quit and version commands.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12720 d7cf8633-e32d-0410-b094-e92efae38249

host.c
host_cmd.c

diff --git a/host.c b/host.c
index 5c9da7eb436e50d41711f09dacfa11bc5165b482..51f3bd3236b93c25fa33ddb671b181b798bf7d69 100644 (file)
--- a/host.c
+++ b/host.c
@@ -213,6 +213,24 @@ static void Host_ServerOptions (void)
                Cvar_SetValueQuick(&deathmatch, 1);
 }
 
+/*
+==================
+Host_Quit_f
+==================
+*/
+void Host_Quit_f(cmd_state_t *cmd)
+{
+       if(host.state == host_shutdown)
+               Con_Printf("shutting down already!\n");
+       else
+               host.state = host_shutdown;
+}
+
+static void Host_Version_f(cmd_state_t *cmd)
+{
+       Con_Printf("Version: %s build %s\n", gamename, buildstring);
+}
+
 /*
 =======================
 Host_InitLocal
@@ -224,6 +242,8 @@ extern cvar_t sv_writepicture_quality;
 extern cvar_t r_texture_jpeg_fastpicmip;
 static void Host_InitLocal (void)
 {
+       Cmd_AddCommand(CMD_SHARED, "quit", Host_Quit_f, "quit the game");
+       Cmd_AddCommand(CMD_SHARED, "version", Host_Version_f, "print engine version");
        Cmd_AddCommand(CMD_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
        Cmd_AddCommand(CMD_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
        Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe);
index 7e4cebfad887f3f33c2040552cf4b7eef8d8c6fc..dc270cf4998b4170ee317f924b060352e15ca776 100644 (file)
@@ -44,22 +44,6 @@ cvar_t skin = {CVAR_CLIENT | CVAR_USERINFO | CVAR_SAVE, "skin", "", "QW player s
 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 cvar_t developer_entityparsing;
-
-/*
-==================
-Host_Quit_f
-==================
-*/
-
-void Host_Quit_f(cmd_state_t *cmd)
-{
-       if(host.state == host_shutdown)
-               Con_Printf("shutting down already!\n");
-       else
-               host.state = host_shutdown;
-}
-
 /*
 ==================
 CL_Reconnect_f
@@ -393,11 +377,6 @@ static void CL_Playerskin_f(cmd_state_t *cmd)
        }
 }
 
-static void Host_Version_f(cmd_state_t *cmd)
-{
-       Con_Printf("Version: %s build %s\n", gamename, buildstring);
-}
-
 /*
 ==================
 CL_Color_f
@@ -1011,10 +990,6 @@ void Host_InitCommands (void)
        Cvar_RegisterVariable(&skin);
        Cvar_RegisterVariable(&noaim);
 
-       // client commands - this includes server commands because the client can host a server, so they must exist
-       Cmd_AddCommand(CMD_SHARED, "quit", Host_Quit_f, "quit the game");
-       Cmd_AddCommand(CMD_SHARED, "version", Host_Version_f, "print engine version");
-
        Cmd_AddCommand(CMD_CLIENT | CMD_SERVER_FROM_CLIENT, "name", CL_Name_f, "change your player name");
        Cmd_AddCommand(CMD_CLIENT | CMD_SERVER_FROM_CLIENT, "color", CL_Color_f, "change your player shirt and pants colors");
        Cmd_AddCommand(CMD_CLIENT | CMD_SERVER_FROM_CLIENT, "rate", CL_Rate_f, "change your network connection speed");