get nq-server so it runs. part of this involved renaming cl_warncmd to

cmd_warncmd
This commit is contained in:
Bill Currie 2001-10-03 21:25:43 +00:00
parent f2cc8d9640
commit 1929797cc9
13 changed files with 47 additions and 38 deletions

View file

@ -148,6 +148,6 @@ void Cmd_Exec_File (const char *path);
extern char com_token[MAX_COM_TOKEN];
const char *COM_Parse (const char *data);
extern struct cvar_s *cl_warncmd;
extern struct cvar_s *cmd_warncmd;
#endif // __cmd_h

View file

@ -61,7 +61,7 @@ cmdalias_t *cmd_alias;
cmd_source_t cmd_source;
qboolean cmd_wait;
cvar_t *cl_warncmd;
cvar_t *cmd_warncmd;
hashtab_t *cmd_alias_hash;
hashtab_t *cmd_hash;
@ -311,7 +311,7 @@ Cmd_Exec_f (void)
Sys_Printf ("couldn't exec %s\n", Cmd_Argv (1));
return;
}
if (!Cvar_Command () && ((cl_warncmd && cl_warncmd->int_val)
if (!Cvar_Command () && (cmd_warncmd->int_val
|| (developer && developer->int_val)))
Sys_Printf ("execing %s\n", Cmd_Argv (1));
@ -859,7 +859,7 @@ Cmd_ExecuteString (const char *text, cmd_source_t src)
return;
}
if (cl_warncmd->int_val || developer->int_val)
if (cmd_warncmd->int_val || developer->int_val)
Sys_Printf ("Unknown command \"%s\"\n", Cmd_Argv (0));
}
@ -993,6 +993,8 @@ Cmd_Init (void)
Cmd_AddCommand ("cmdlist", Cmd_CmdList_f, "List all commands");
Cmd_AddCommand ("help", Cmd_Help_f, "Display help for a command or "
"variable");
cmd_warncmd = Cvar_Get ("cmd_warncmd", "1", CVAR_NONE, NULL, "Toggles the "
"display of error messages for unknown commands");
}
char com_token[MAX_COM_TOKEN];

View file

@ -210,6 +210,7 @@ nq_wgl_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
# Dedicated Server
ded_sources= sys_unixd.c sv_ded.c sv_model.c
nq_server_LDFLAGS= $(common_ldflags)
nq_server_SOURCES= $(common_sources) $(server_sources) $(ded_sources)
nq_server_LDADD= $(server_LIBS)
nq_server_DEPENDENCIES= $(server_LIB_DEPSS)

View file

@ -109,8 +109,6 @@ CL_InitCvars (void)
cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, NULL,
"Shift view colors on damage");
cl_cshift_powerup = Cvar_Get ("cl_cshift_powerup", "1", CVAR_ARCHIVE, NULL, "Shift view colors for powerups");
cl_warncmd = Cvar_Get ("cl_warncmd", "0", CVAR_NONE, NULL,
"inform when execing a command");
cl_name = Cvar_Get ("_cl_name", "player", CVAR_ARCHIVE, NULL,
"Player name");
cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, NULL, "Player color");

View file

@ -638,3 +638,8 @@ Con_CompleteCommandLine (void)
if (list[i])
free (list[i]);
}
void
Con_ProcessInput (void)
{
}

View file

@ -546,14 +546,7 @@ Host_FilterTime (float time)
void
Host_GetConsoleCommands (void)
{
const char *cmd;
while (1) {
cmd = Sys_ConsoleInput ();
if (!cmd)
break;
Cbuf_AddText (cmd);
}
Con_ProcessInput ();
}
#ifdef FPS_20
@ -936,6 +929,11 @@ Host_Init (quakeparms_t *parms)
PI_Init ();
if (isDedicated)
Con_Init ("server");
else
Con_Init ("client");
V_Init ();
COM_Init ();
@ -947,7 +945,6 @@ Host_Init (quakeparms_t *parms)
Host_InitLocal ();
W_LoadWadFile ("gfx.wad");
Key_Init ();
Con_Init ("client");
// FIXME: MENUCODE
// M_Init ();
PR_Init ();
@ -986,7 +983,7 @@ Host_Init (quakeparms_t *parms)
CL_SetState (ca_disconnected);
}
if (cl_quakerc->int_val)
if (!isDedicated && cl_quakerc->int_val)
Cbuf_InsertText ("exec quake.rc\n");
Cmd_Exec_File (fs_usercfg->string);
// reparse the command line for + commands other than set

View file

@ -116,6 +116,8 @@ CL_Init (void)
void
CL_InitCvars (void)
{
cl_name = Cvar_Get ("_cl_name", "player", CVAR_ARCHIVE, NULL, "");
cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, NULL, "");
}
void
@ -147,6 +149,7 @@ CL_StopPlayback (void)
void
Chase_Init_Cvars (void)
{
chase_active = Cvar_Get ("chase_active", "0", CVAR_NONE, NULL, "None");
}
void

View file

@ -160,20 +160,22 @@ main (int c, const char *v[])
parms.argc = com_argc;
parms.argv = com_argv;
parms.memsize = 16 * 1024 * 1024;
isDedicated = (COM_CheckParm ("-dedicated") != 0);
parms.memsize = 16 * 1024 * 1024;
j = COM_CheckParm ("-mem");
if (j)
parms.memsize = (int) (atof (com_argv[j + 1]) * 1024 * 1024);
parms.membase = malloc (parms.memsize);
if ((parms.membase = malloc (parms.memsize)) == NULL)
Sys_Error ("Can't allocate %d\n", parms.memsize);
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
Sys_RegisterShutdown (Host_Shutdown);
Sys_RegisterShutdown (shutdown);
Sys_Printf ("Host_Init\n");
Host_Init (&parms);
Sys_Init_Cvars ();

View file

@ -65,7 +65,7 @@ static const char rcsid[] =
#include "client.h"
#include "host.h"
qboolean isDedicated;
qboolean isDedicated = true;
int nostdout = 0;
@ -198,7 +198,7 @@ Sys_LowFPPrecision (void)
int
main (int argc, const char **argv)
{
double time, oldtime;
double time, oldtime, newtime;
quakeparms_t parms;
const char *newargv[256];
int j;
@ -224,9 +224,8 @@ main (int argc, const char **argv)
parms.memsize = 16 * 1024 * 1024;
j = COM_CheckParm ("-mem");
if (j) {
if (j)
parms.memsize = (int) (atof (com_argv[j + 1]) * 1024 * 1024);
}
if ((parms.membase = malloc (parms.memsize)) == NULL)
Sys_Error ("Can't allocate %d\n", parms.memsize);
@ -235,21 +234,29 @@ main (int argc, const char **argv)
Sys_RegisterShutdown (Host_Shutdown);
Sys_RegisterShutdown (shutdown);
printf ("Host_Init\n");
Sys_Printf ("Host_Init\n");
Host_Init (&parms);
Sys_Init_Cvars ();
Sys_Init ();
oldtime = Sys_DoubleTime () - 0.1;
while (1) { // Main message loop
time = Sys_DoubleTime ();
if ((time - oldtime) < sys_ticrate->value) {
// find time spent rendering last frame
newtime = Sys_DoubleTime ();
time = newtime - oldtime;
if (time < sys_ticrate->value) {
usleep (1);
continue;
}
Host_Frame (time - oldtime);
time = sys_ticrate->value;
if (time > sys_ticrate->value * 2)
oldtime = newtime;
else
oldtime += time;
Host_Frame (time);
oldtime = time;
}
return true; // return success

View file

@ -278,7 +278,6 @@ typedef struct
/*
cvars
*/
extern struct cvar_s *cl_warncmd;
extern struct cvar_s *cl_upspeed;
extern struct cvar_s *cl_forwardspeed;
extern struct cvar_s *cl_backspeed;

View file

@ -1194,8 +1194,6 @@ CL_Init_Cvars (void)
cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, NULL,
"adjust demo playback speed. 1.0 = normal, "
"< 1 slow-mo, > 1 timelapse");
cl_warncmd = Cvar_Get ("cl_warncmd", "0", CVAR_NONE, NULL,
"inform when execing a command");
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, NULL,
"turn `run' speed multiplier");
cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL,
@ -1674,7 +1672,7 @@ Host_Init (void)
Cbuf_AddText ("echo Type connect <internet address> or use a server "
"browser to connect to a game.\n");
Cbuf_AddText ("cl_warncmd 1\n");
Cbuf_AddText ("cmd_warncmd 1\n");
Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
host_hunklevel = Hunk_LowMark ();

View file

@ -650,15 +650,15 @@ CL_ParseServerData (void)
// ZOID--run the autoexec.cfg in the gamedir
// if it exists
if (cflag) {
int cl_warncmd_val = cl_warncmd->int_val;
int cmd_warncmd_val = cmd_warncmd->int_val;
Cbuf_AddText ("cl_warncmd 0\n");
Cbuf_AddText ("cmd_warncmd 0\n");
Cbuf_AddText ("exec config.cfg\n");
Cbuf_AddText ("exec frontend.cfg\n");
if (cl_autoexec->int_val) {
Cbuf_AddText ("exec autoexec.cfg\n");
}
snprintf (fn, sizeof (fn), "cl_warncmd %d\n", cl_warncmd_val);
snprintf (fn, sizeof (fn), "cmd_warncmd %d\n", cmd_warncmd_val);
Cbuf_AddText (fn);
}
// parse player slot, high bit means spectator

View file

@ -58,7 +58,6 @@ qboolean sv_allow_cheats;
int fp_messages = 4, fp_persecond = 4, fp_secondsdead = 10;
char fp_msg[255] = { 0 };
extern cvar_t *cl_warncmd;
cvar_t *sv_leetnickmatch;
extern redirect_t sv_redirected;
@ -1217,8 +1216,6 @@ SV_InitOperatorCommands (void)
Cmd_AddCommand ("match", SV_Match_f, "matches nicks as ban/cuff/mute "
"commands do, so you can check safely");
cl_warncmd = Cvar_Get ("cl_warncmd", "1", CVAR_NONE, NULL, "Toggles the "
"display of error messages for unknown commands");
// poor description
sv_leetnickmatch = Cvar_Get ("sv_3133735_7h4n_7h0u", "1", CVAR_NONE, NULL,
"Match '1' as 'i' and such in nicks");