From 49b4a7773641bbf2a0395bfc43534dc5fa8b5f5f Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Mon, 7 Sep 2020 23:57:33 +0000 Subject: [PATCH] Rename src_command to src_local, to clarify its meaning git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12909 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_cmd.c | 4 ++-- cl_demo.c | 2 +- cl_parse.c | 4 ++-- cmd.c | 6 +++--- cmd.h | 2 +- csprogs.c | 6 +++--- keys.c | 2 +- netconn.c | 2 +- sv_ccmds.c | 20 ++++++++++---------- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cl_cmd.c b/cl_cmd.c index e8f90268..5be2189b 100644 --- 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); diff --git a/cl_demo.c b/cl_demo.c index 5acbaa4e..31a1f470 100644 --- 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); diff --git a/cl_parse.c b/cl_parse.c index e35e43c2..45a2b989 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -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 6f76df95..fdc55848 100644 --- 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 8a8d32b9..175a1537 100644 --- 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 diff --git a/csprogs.c b/csprogs.c index 700796a7..97118eb2 100644 --- 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 7363590e..5a67502f 100644 --- 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)); diff --git a/netconn.c b/netconn.c index 4425dfd5..867c6162 100755 --- 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) } diff --git a/sv_ccmds.c b/sv_ccmds.c index 54718de3..e3331dce 100644 --- a/sv_ccmds.c +++ b/sv_ccmds.c @@ -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"; -- 2.39.2