mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-16 17:01:53 +00:00
clean up the mess caused by attempting to merge cmd.[ch]. When taken further,
this might give us nice controlability of when cvars can be changed.
This commit is contained in:
parent
d1313dfebb
commit
9aa50a847c
12 changed files with 29 additions and 28 deletions
|
@ -120,10 +120,7 @@ void Cmd_TokenizeString (char *text);
|
|||
// Takes a null terminated string. Does not need to be /n terminated.
|
||||
// breaks the string up into arg tokens.
|
||||
|
||||
void Cmd_ExecuteString (char *text);
|
||||
// Parses a single line of text into arguments and tries to execute it
|
||||
// as if it was typed at the console
|
||||
void Cmd_ExecuteString_src (char *text, cmd_source_t src);
|
||||
void Cmd_ExecuteString (char *text, cmd_source_t src);
|
||||
// Parses a single line of text into arguments and tries to execute it.
|
||||
// The text can come from the command buffer, a remote client, or stdin.
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef struct cmdalias_s {
|
|||
} cmdalias_t;
|
||||
|
||||
cmdalias_t *cmd_alias;
|
||||
|
||||
cmd_source_t cmd_source;
|
||||
qboolean cmd_wait;
|
||||
|
||||
cvar_t *cl_warncmd;
|
||||
|
@ -204,7 +204,7 @@ Cbuf_Execute (void)
|
|||
extract_line (line);
|
||||
// execute the command line
|
||||
// Con_DPrintf("+%s\n",line),
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
|
||||
if (cmd_wait) { // skip out while text still remains
|
||||
// in buffer, leaving it
|
||||
|
@ -230,11 +230,11 @@ Cbuf_Execute_Sets (void)
|
|||
// execute the command line
|
||||
if (strnequal (line, "set", 3) && isspace ((int) line[3])) {
|
||||
// Con_DPrintf ("+%s\n",line);
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
}
|
||||
if (strnequal (line, "setrom", 6) && isspace ((int) line[6])) {
|
||||
// Con_DPrintf ("+%s\n",line);
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -733,12 +733,14 @@ Cmd_ExpandVariables (char *data, char *dest)
|
|||
FIXME: lookupnoadd the token to speed search?
|
||||
*/
|
||||
void
|
||||
Cmd_ExecuteString (char *text)
|
||||
Cmd_ExecuteString (char *text, cmd_source_t src)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmdalias_t *a;
|
||||
char buf[1024];
|
||||
|
||||
cmd_source = src;
|
||||
|
||||
#if 0
|
||||
Cmd_TokenizeString (text);
|
||||
#else
|
||||
|
|
|
@ -257,7 +257,7 @@ void CL_Record_f (void)
|
|||
// start the map up
|
||||
//
|
||||
if (c > 2)
|
||||
Cmd_ExecuteString_src ( va("map %s", Cmd_Argv(2)), src_command);
|
||||
Cmd_ExecuteString ( va("map %s", Cmd_Argv(2)), src_command);
|
||||
|
||||
//
|
||||
// open the demo file
|
||||
|
|
|
@ -964,7 +964,7 @@ void CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_sellscreen:
|
||||
Cmd_ExecuteString_src ("help", src_command);
|
||||
Cmd_ExecuteString ("help", src_command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ Cbuf_Execute (void)
|
|||
extract_line (line);
|
||||
// execute the command line
|
||||
//Con_DPrintf("+%s\n",line),
|
||||
Cmd_ExecuteString_src (line, src_command);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
|
||||
if (cmd_wait)
|
||||
{ // skip out while text still remains in buffer, leaving it
|
||||
|
@ -265,7 +265,7 @@ Cbuf_Execute_Sets (void)
|
|||
if (strncmp(line,"set",3)==0
|
||||
&& isspace((int) line[3]))
|
||||
//Con_DPrintf("+%s\n",line),
|
||||
Cmd_ExecuteString_src (line, src_command);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,13 +812,13 @@ void Cmd_ExpandVariables (char *data, char *dest)
|
|||
|
||||
/*
|
||||
============
|
||||
Cmd_ExecuteString_src
|
||||
Cmd_ExecuteString
|
||||
|
||||
A complete command line has been parsed, so try to execute it
|
||||
FIXME: lookupnoadd the token to speed search?
|
||||
============
|
||||
*/
|
||||
void Cmd_ExecuteString_src (char *text, cmd_source_t src)
|
||||
void Cmd_ExecuteString (char *text, cmd_source_t src)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmdalias_t *a;
|
||||
|
|
|
@ -145,7 +145,7 @@ int GIB_Con_f (void)
|
|||
if (GIB_Argc() != 1)
|
||||
return GIB_E_NUMARGS;
|
||||
|
||||
Cmd_ExecuteString_src (GIB_Argv(1), src_command);
|
||||
Cmd_ExecuteString (GIB_Argv(1), src_command);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -222,4 +222,4 @@ int GIB_ExpandBackticks (char *source, char *buffer, int buffersize)
|
|||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ void Host_Map_f (void)
|
|||
strcat (cls.spawnparms, " ");
|
||||
}
|
||||
|
||||
Cmd_ExecuteString_src ("connect local", src_command);
|
||||
Cmd_ExecuteString ("connect local", src_command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1002,7 +1002,7 @@ void SV_SendReconnect (void)
|
|||
#ifdef QUAKE2
|
||||
Cbuf_InsertText ("reconnect\n");
|
||||
#else
|
||||
Cmd_ExecuteString_src ("reconnect\n", src_command);
|
||||
Cmd_ExecuteString ("reconnect\n", src_command);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -589,7 +589,7 @@ nextmsg:
|
|||
if (ret == 2)
|
||||
Cbuf_InsertText (s);
|
||||
else if (ret == 1)
|
||||
Cmd_ExecuteString_src (s, src_client);
|
||||
Cmd_ExecuteString (s, src_client);
|
||||
else
|
||||
Con_DPrintf("%s tried to %s\n", host_client->name, s);
|
||||
break;
|
||||
|
|
|
@ -1346,7 +1346,7 @@ CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_sellscreen:
|
||||
Cmd_ExecuteString ("help");
|
||||
Cmd_ExecuteString ("help", src_command);
|
||||
break;
|
||||
|
||||
case svc_smallkick:
|
||||
|
|
|
@ -61,7 +61,7 @@ typedef struct cmdalias_s {
|
|||
} cmdalias_t;
|
||||
|
||||
cmdalias_t *cmd_alias;
|
||||
|
||||
cmd_source_t cmd_source;
|
||||
qboolean cmd_wait;
|
||||
|
||||
cvar_t *cl_warncmd;
|
||||
|
@ -205,7 +205,7 @@ Cbuf_Execute (void)
|
|||
extract_line (line);
|
||||
// execute the command line
|
||||
// Con_DPrintf("+%s\n",line),
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
|
||||
if (cmd_wait) { // skip out while text still remains
|
||||
// in buffer, leaving it
|
||||
|
@ -231,11 +231,11 @@ Cbuf_Execute_Sets (void)
|
|||
// execute the command line
|
||||
if (strnequal (line, "set", 3) && isspace ((int) line[3])) {
|
||||
// Con_DPrintf ("+%s\n",line);
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
}
|
||||
if (strnequal (line, "setrom", 6) && isspace ((int) line[6])) {
|
||||
// Con_DPrintf ("+%s\n",line);
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -738,12 +738,14 @@ Cmd_ExpandVariables (char *data, char *dest)
|
|||
FIXME: lookupnoadd the token to speed search?
|
||||
*/
|
||||
void
|
||||
Cmd_ExecuteString (char *text)
|
||||
Cmd_ExecuteString (char *text, cmd_source_t src)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmdalias_t *a;
|
||||
char buf[1024];
|
||||
|
||||
cmd_source = src;
|
||||
|
||||
#if 0
|
||||
Cmd_TokenizeString (text);
|
||||
#else
|
||||
|
|
|
@ -910,7 +910,7 @@ SVC_RemoteCommand (void)
|
|||
|
||||
SV_BeginRedirect (RD_PACKET);
|
||||
|
||||
Cmd_ExecuteString (remaining);
|
||||
Cmd_ExecuteString (remaining, src_command);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1956,7 +1956,7 @@ SV_Init (void)
|
|||
|
||||
// if a map wasn't specified on the command line, spawn start.map
|
||||
if (sv.state == ss_dead)
|
||||
Cmd_ExecuteString ("map start");
|
||||
Cmd_ExecuteString ("map start", src_command);
|
||||
if (sv.state == ss_dead)
|
||||
SV_Error ("Couldn't spawn a server");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue