mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Apply client and server config tweaks when loading the original config
This commit is contained in:
parent
b8c7223da7
commit
02fc573e31
6 changed files with 42 additions and 1 deletions
|
@ -3685,6 +3685,12 @@ void CL_Init( void ) {
|
||||||
|
|
||||||
end = Sys_Milliseconds();
|
end = Sys_Milliseconds();
|
||||||
|
|
||||||
|
if (com_gotOriginalConfig) {
|
||||||
|
// Added in OPM
|
||||||
|
// Apply config tweaks after loading the original config
|
||||||
|
CL_ApplyOriginalConfigTweaks();
|
||||||
|
}
|
||||||
|
|
||||||
Com_Printf( "----- Client Initialization Complete ----- %i ms\n", start - end );
|
Com_Printf( "----- Client Initialization Complete ----- %i ms\n", start - end );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4861,3 +4867,15 @@ void TIKI_CG_Command_ProcessFile(char* filename, qboolean quiet, dtiki_t* curTik
|
||||||
|
|
||||||
Com_Printf("NO CGE \n");
|
Com_Printf("NO CGE \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CL_ApplyOriginalConfigTweaks()
|
||||||
|
{
|
||||||
|
cvar_t* snaps = Cvar_Get("snaps", "", 0);
|
||||||
|
|
||||||
|
// Those variables are not editable via UI so reset them
|
||||||
|
// snaps/maxpackets can also have wrong values due to them being changed
|
||||||
|
// via stufftext
|
||||||
|
|
||||||
|
Cvar_Set("snaps", snaps->resetString);
|
||||||
|
Cvar_Set("cl_maxpackets", cl_maxpackets->resetString);
|
||||||
|
}
|
||||||
|
|
|
@ -561,6 +561,7 @@ qboolean CL_CheckPaused(void);
|
||||||
|
|
||||||
int CL_GetRefSequence(void);
|
int CL_GetRefSequence(void);
|
||||||
qboolean CL_IsRendererLoaded(void);
|
qboolean CL_IsRendererLoaded(void);
|
||||||
|
void CL_ApplyOriginalConfigTweaks();
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_input
|
// cl_input
|
||||||
|
|
|
@ -144,6 +144,7 @@ qboolean com_errorEntered = qfalse;
|
||||||
qboolean com_fullyInitialized = qfalse;
|
qboolean com_fullyInitialized = qfalse;
|
||||||
qboolean com_gameRestarting = qfalse;
|
qboolean com_gameRestarting = qfalse;
|
||||||
qboolean com_gameClientRestarting = qfalse;
|
qboolean com_gameClientRestarting = qfalse;
|
||||||
|
qboolean com_gotOriginalConfig = qfalse;
|
||||||
|
|
||||||
char com_errorMessage[MAXPRINTMSG];
|
char com_errorMessage[MAXPRINTMSG];
|
||||||
|
|
||||||
|
@ -1695,6 +1696,7 @@ void Com_Init( char *commandLine ) {
|
||||||
const char *s;
|
const char *s;
|
||||||
char configname[ 128 ];
|
char configname[ 128 ];
|
||||||
int qport;
|
int qport;
|
||||||
|
qboolean configExists;
|
||||||
|
|
||||||
Com_Printf( "--- Common Initialization ---\n" );
|
Com_Printf( "--- Common Initialization ---\n" );
|
||||||
|
|
||||||
|
@ -1794,9 +1796,12 @@ void Com_Init( char *commandLine ) {
|
||||||
Cvar_Set( "config", configname );
|
Cvar_Set( "config", configname );
|
||||||
Com_Printf( "Config: %s\n", configname );
|
Com_Printf( "Config: %s\n", configname );
|
||||||
|
|
||||||
if ( !Com_ConfigExists( configname )) {
|
configExists = Com_ConfigExists(configname);
|
||||||
|
|
||||||
|
if ( !configExists ) {
|
||||||
Com_Printf( "The config file '%s' doesn't exist, using unnamedsoldier.cfg as a template\n", configname );
|
Com_Printf( "The config file '%s' doesn't exist, using unnamedsoldier.cfg as a template\n", configname );
|
||||||
Cbuf_AddText( va( "exec configs/unnamedsoldier.cfg\n", configname ) );
|
Cbuf_AddText( va( "exec configs/unnamedsoldier.cfg\n", configname ) );
|
||||||
|
com_gotOriginalConfig = qtrue;
|
||||||
} else {
|
} else {
|
||||||
Cbuf_AddText( va( "exec configs/%s\n", configname ) );
|
Cbuf_AddText( va( "exec configs/%s\n", configname ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1074,6 +1074,7 @@ extern int com_frameMsec;
|
||||||
|
|
||||||
extern qboolean com_errorEntered;
|
extern qboolean com_errorEntered;
|
||||||
extern qboolean com_fullyInitialized;
|
extern qboolean com_fullyInitialized;
|
||||||
|
extern qboolean com_gotOriginalConfig;
|
||||||
|
|
||||||
extern fileHandle_t com_journalFile;
|
extern fileHandle_t com_journalFile;
|
||||||
extern fileHandle_t com_journalDataFile;
|
extern fileHandle_t com_journalDataFile;
|
||||||
|
|
|
@ -489,6 +489,8 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
|
||||||
int SV_PVSSoundIndex(const char* name, qboolean streamed);
|
int SV_PVSSoundIndex(const char* name, qboolean streamed);
|
||||||
void SV_HandleNonPVSSound();
|
void SV_HandleNonPVSSound();
|
||||||
|
|
||||||
|
void SV_ApplyOriginalConfigTweaks();
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// sv_client.c
|
// sv_client.c
|
||||||
|
|
|
@ -1109,6 +1109,12 @@ void SV_Init (void)
|
||||||
|
|
||||||
// Load saved bans
|
// Load saved bans
|
||||||
Cbuf_AddText("rehashbans\n");
|
Cbuf_AddText("rehashbans\n");
|
||||||
|
|
||||||
|
if (com_gotOriginalConfig) {
|
||||||
|
// Added in OPM
|
||||||
|
// Apply config tweaks after loading the original config
|
||||||
|
SV_ApplyOriginalConfigTweaks();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1325,3 +1331,11 @@ void SV_HandleNonPVSSound()
|
||||||
SV_CleanupNonPVSSound();
|
SV_CleanupNonPVSSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
===============
|
||||||
|
SV_ApplyOriginalConfigTweaks
|
||||||
|
===============
|
||||||
|
*/
|
||||||
|
void SV_ApplyOriginalConfigTweaks()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue