]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Rename src_command to src_local, to clarify its meaning
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Sep 2020 23:57:33 +0000 (23:57 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Sep 2020 23:57:33 +0000 (23:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12909 d7cf8633-e32d-0410-b094-e92efae38249

cl_cmd.c
cl_demo.c
cl_parse.c
cmd.c
cmd.h
csprogs.c
keys.c
netconn.c
sv_ccmds.c

index e8f90268951fdc6f5876493a0ff87f7cf6f27b33..5be2189b887bc22f613c45bf8026c00fe2ab4ba7 100644 (file)
--- a/cl_cmd.c
+++ b/cl_cmd.c
@@ -252,7 +252,7 @@ static void CL_Color_f(cmd_state_t *cmd)
 
        if (Cmd_Argc(cmd) == 1)
        {
-               if (cmd->source == src_command)
+               if (cmd->source == src_local)
                {
                        Con_Printf("\"color\" is \"%i %i\"\n", cl_topcolor.integer, cl_bottomcolor.integer);
                        Con_Print("color <0-15> [0-15]\n");
@@ -287,7 +287,7 @@ static void CL_Color_f(cmd_state_t *cmd)
        //if (bottom > 13)
        //      bottom = 13;
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
        {
                Cvar_SetValueQuick(&cl_topcolor, top);
                Cvar_SetValueQuick(&cl_bottomcolor, bottom);
index 5acbaa4eec825a211ded2e1b1da4a063cf7007b6..31a1f470b2a9898915a85c998e211ccbd11ce761 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -382,7 +382,7 @@ void CL_Record_f(cmd_state_t *cmd)
 
        // start the map up
        if (c > 2)
-               Cmd_ExecuteString ( cmd, va(vabuf, sizeof(vabuf), "map %s", Cmd_Argv(cmd, 2)), src_command, false);
+               Cmd_ExecuteString ( cmd, va(vabuf, sizeof(vabuf), "map %s", Cmd_Argv(cmd, 2)), src_local, false);
 
        // open the demo file
        Con_Printf("recording to %s.\n", name);
index e35e43c2fffd26c57cc98c0eb9cb795dc1e9b136..45a2b9899c7b5664f77a577c27c653edfd563184 100644 (file)
@@ -3658,7 +3658,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case qw_svc_sellscreen:
-                               Cmd_ExecuteString(&cmd_client, "help", src_command, true);
+                               Cmd_ExecuteString(&cmd_client, "help", src_local, true);
                                break;
 
                        case qw_svc_smallkick:
@@ -4165,7 +4165,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case svc_sellscreen:
-                               Cmd_ExecuteString(&cmd_client, "help", src_command, true);
+                               Cmd_ExecuteString(&cmd_client, "help", src_local, true);
                                break;
                        case svc_hidelmp:
                                if (gamemode == GAME_TENEBRAE)
diff --git a/cmd.c b/cmd.c
index 6f76df95c3fa740679f3e285010179119b4d2336..fdc55848575a6d9b960da0299e87d7eed0d25505 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -507,11 +507,11 @@ void Cbuf_Execute (cbuf_t *cbuf)
                   (strncmp(firstchar, "in_bind", 7) || !ISWHITESPACE(firstchar[7])))
                {
                        if(Cmd_PreprocessString(current->source, current->text, preprocessed, sizeof(preprocessed), NULL ))
-                               Cmd_ExecuteString(current->source, preprocessed, src_command, false);
+                               Cmd_ExecuteString(current->source, preprocessed, src_local, false);
                }
                else
                {
-                       Cmd_ExecuteString (current->source, current->text, src_command, false);
+                       Cmd_ExecuteString (current->source, current->text, src_local, false);
                }
 
                // Recycle memory so using WASD doesn't cause a malloc and free
@@ -2225,7 +2225,7 @@ void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qb
                {
                        switch (src)
                        {
-                       case src_command:
+                       case src_local:
                                if (func->function)
                                        func->function(cmd);
                                else
diff --git a/cmd.h b/cmd.h
index 8a8d32b9475b7c132e3fed3c1aae4f569f28df7e..175a1537d1e55eacd59a2ba54ec1fdb214010ad7 100644 (file)
--- a/cmd.h
+++ b/cmd.h
@@ -58,7 +58,7 @@ typedef enum
 {
        src_client,             ///< came in over a net connection as a clc_stringcmd
                                        ///< host_client will be valid during this state.
-       src_command             ///< from the command buffer
+       src_local               ///< from the command buffer
 } cmd_source_t;
 
 typedef struct cmdalias_s
index 700796a7f6f02e4c7052eee7ac00e2bd312a71ec..97118eb267928a2d3cebe9db09d734acdddb45fe 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -564,7 +564,7 @@ void CL_VM_Parse_StuffCmd (const char *msg)
                int crcflags = csqc_progcrc.flags;
                csqc_progcrc.flags &= ~CVAR_READONLY;
                csqc_progsize.flags &= ~CVAR_READONLY;
-               Cmd_ExecuteString(&cmd_client, msg, src_command, true);
+               Cmd_ExecuteString(&cmd_client, msg, src_local, true);
                csqc_progcrc.flags = csqc_progsize.flags = crcflags;
                return;
        }
@@ -596,7 +596,7 @@ void CL_VM_Parse_StuffCmd (const char *msg)
                                l = sizeof(buf) - 1;
                        strlcpy(buf, p, l + 1); // strlcpy needs a + 1 as it includes the newline!
 
-                       Cmd_ExecuteString(&cmd_client, buf, src_command, true);
+                       Cmd_ExecuteString(&cmd_client, buf, src_local, true);
 
                        p += l;
                        if(*p == '\n')
@@ -604,7 +604,7 @@ void CL_VM_Parse_StuffCmd (const char *msg)
                        else
                                break; // end of string or overflow
                }
-               Cmd_ExecuteString(&cmd_client, "curl --clear_autodownload", src_command, true); // don't inhibit CSQC loading
+               Cmd_ExecuteString(&cmd_client, "curl --clear_autodownload", src_local, true); // don't inhibit CSQC loading
                return;
        }
 
diff --git a/keys.c b/keys.c
index 7363590efdf3cee0265f297d105226706d2fbf9a..5a67502ffe147595386a07cba05ff18563b3a804 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1305,7 +1305,7 @@ Key_Message (cmd_state_t *cmd, int key, int ascii)
        if (key == K_ENTER || key == K_KP_ENTER || ascii == 10 || ascii == 13)
        {
                if(chat_mode < 0)
-                       Cmd_ExecuteString(cmd, chat_buffer, src_command, true); // not Cbuf_AddText to allow semiclons in args; however, this allows no variables then. Use aliases!
+                       Cmd_ExecuteString(cmd, chat_buffer, src_local, true); // not Cbuf_AddText to allow semiclons in args; however, this allows no variables then. Use aliases!
                else
                        CL_ForwardToServer(va(vabuf, sizeof(vabuf), "%s %s", chat_mode ? "say_team" : "say ", chat_buffer));
 
index 4425dfd5002cf74e57bbb3e0ecc52264279626ac..867c6162772807e3e2eb991fd742a81b60d6c6f0 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -2921,7 +2921,7 @@ static void RCon_Execute(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, c
                        if(l)
                        {
                                client_t *host_client_save = host_client;
-                               Cmd_ExecuteString(&cmd_server, s, src_command, true);
+                               Cmd_ExecuteString(&cmd_server, s, src_local, true);
                                host_client = host_client_save;
                                // in case it is a command that changes host_client (like restart)
                        }
index 54718de387227133b271b0e343e913f103e5f701..e3331dce0995c96997267b6b8f1ee50a1e2494e4 100644 (file)
@@ -411,7 +411,7 @@ SV_Pause_f
 static void SV_Pause_f(cmd_state_t *cmd)
 {
        void (*print) (const char *fmt, ...);
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                print = Con_Printf;
        else
                print = SV_ClientPrintf;
@@ -429,7 +429,7 @@ static void SV_Pause_f(cmd_state_t *cmd)
        }
        
        sv.paused ^= 1;
-       if (cmd->source != src_command)
+       if (cmd->source != src_local)
                SV_BroadcastPrintf("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
        else if(*(sv_adminnick.string))
                SV_BroadcastPrintf("%s %spaused the game\n", sv_adminnick.string, sv.paused ? "" : "un");
@@ -451,7 +451,7 @@ static void SV_Say(cmd_state_t *cmd, qboolean teamonly)
        char text[1024];
        qboolean fromServer = false;
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
        {
                fromServer = true;
                teamonly = false;
@@ -521,7 +521,7 @@ static void SV_Tell_f(cmd_state_t *cmd)
        char text[MAX_INPUTLINE]; // LadyHavoc: FIXME: temporary buffer overflow fix (was 64)
        qboolean fromServer = false;
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                fromServer = true;
 
        if (Cmd_Argc (cmd) < 2)
@@ -642,7 +642,7 @@ static void SV_Ping_f(cmd_state_t *cmd)
        client_t *client;
        void (*print) (const char *fmt, ...);
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                print = Con_Printf;
        else
                print = SV_ClientPrintf;
@@ -796,7 +796,7 @@ static void SV_Status_f(cmd_state_t *cmd)
        int frags;
        char vabuf[1024];
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                print = Con_Printf;
        else
                print = SV_ClientPrintf;
@@ -858,7 +858,7 @@ static void SV_Status_f(cmd_state_t *cmd)
                        ping = bound(0, (int)floor(client->ping*1000+0.5), 9999);
                }
 
-               if(sv_status_privacy.integer && cmd->source != src_command && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
+               if(sv_status_privacy.integer && cmd->source != src_local && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
                        strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
                else
                        strlcpy(ip, (client->netconnection && *client->netconnection->address) ? client->netconnection->address : "botclient", 48);
@@ -948,7 +948,7 @@ static void SV_Name_f(cmd_state_t *cmd)
 
        strlcpy(newName, newNameSource, sizeof(newName));
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                return;
 
        if (host.realtime < host_client->nametime && strcmp(newName, host_client->name))
@@ -1036,7 +1036,7 @@ static void SV_Rate_f(cmd_state_t *cmd)
 
        rate = atoi(Cmd_Argv(cmd, 1));
 
-       if (cmd->source == src_command)
+       if (cmd->source == src_local)
                return;
 
        host_client->rate = rate;
@@ -1135,7 +1135,7 @@ static void SV_Kick_f(cmd_state_t *cmd)
 
        if (i < svs.maxclients)
        {
-               if (cmd->source == src_command)
+               if (cmd->source == src_local)
                {
                        if (cls.state == ca_dedicated)
                                who = "Console";