add fs_usercfg. defaults to "" (nothing) in oldstyle, or "~/.PACKAGErc" in

newstyle.
This commit is contained in:
Bill Currie 2001-02-10 00:40:55 +00:00
parent 4eb41da471
commit 0ffba7e3da
7 changed files with 46 additions and 7 deletions

View file

@ -105,6 +105,7 @@ qboolean noclip_anglehack; // remnant from old quake
cvar_t *fs_globalcfg;
cvar_t *fs_usercfg;
cvar_t *rcon_password;
cvar_t *rcon_address;
@ -1561,6 +1562,15 @@ Host_Init (void)
Cmd_StuffCmds_f ();
Cbuf_Execute_Sets ();
fs_usercfg = Cvar_Get ("fs_usercfg", FS_USERCFG,
CVAR_ROM, "user configuration file");
Cmd_Exec_File (fs_usercfg->string);
Cbuf_Execute_Sets ();
// execute +set again to override the config file
Cmd_StuffCmds_f ();
Cbuf_Execute_Sets ();
CL_Cam_Init_Cvars ();
CL_Input_Init_Cvars ();
Skin_Init_Cvars ();

View file

@ -303,24 +303,18 @@ void
Cmd_Exec_File (char *path)
{
char *f;
int mark;
int len;
char base[32];
QFile *file;
if ((file = Qopen (path, "r")) != NULL) {
// extract the filename base name for hunk tag
COM_FileBase (path, base);
len = COM_filelength (file);
mark = Hunk_LowMark ();
f = (char *) Hunk_AllocName (len + 1, base);
f = (char *) Hunk_TempAlloc (len + 1);
if (f) {
f[len] = 0;
Qread (file, f, len);
Qclose (file);
Cbuf_InsertText (f);
}
Hunk_FreeToLowMark (mark);
}
}

View file

@ -80,6 +80,7 @@ cvar_t *sv_allow_log;
cvar_t *sv_allow_ping;
cvar_t *fs_globalcfg;
cvar_t *fs_usercfg;
cvar_t *sv_mintic; // bound the size of the
cvar_t *sv_maxtic; // physics time tic
@ -1900,6 +1901,16 @@ SV_Init (void)
Cmd_StuffCmds_f ();
Cbuf_Execute_Sets ();
fs_usercfg = Cvar_Get ("fs_usercfg", FS_USERCFG,
CVAR_ROM, "user configuration file");
Cmd_Exec_File (fs_usercfg->string);
Cbuf_Execute_Sets ();
// execute +set again to override the config file
Cmd_StuffCmds_f ();
Cbuf_Execute_Sets ();
COM_Filesystem_Init_Cvars ();
COM_Init_Cvars ();
Mod_Init_Cvars ();