From 0984368a3178dc580762b6c92732833367abd13e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 11 Feb 2023 07:22:04 +0300 Subject: [PATCH] engine: server: GoldSrc compliant pfnServerExecute(), don't execute config.cfg for server! --- engine/common/common.h | 1 - engine/common/cvar.c | 2 -- engine/server/server.h | 1 - engine/server/sv_game.c | 15 --------------- 4 files changed, 19 deletions(-) diff --git a/engine/common/common.h b/engine/common/common.h index b54b9b99..3d747d3c 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -365,7 +365,6 @@ typedef struct host_parm_s qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands qboolean apply_opengl_config;// when true apply only to opengl cvars and ignore all other commands qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc - int sv_cvars_restored; // count of restored server cvars qboolean crashed; // set to true if crashed qboolean daemonized; qboolean enabledll; diff --git a/engine/common/cvar.c b/engine/common/cvar.c index 569db02a..397a5808 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -1021,8 +1021,6 @@ qboolean Cvar_CommandWithPrivilegeCheck( convar_t *v, qboolean isPrivileged ) else { Cvar_DirectSet( v, Cmd_Argv( 1 )); - if( host.apply_game_config ) - host.sv_cvars_restored++; return true; } } diff --git a/engine/server/server.h b/engine/server/server.h index eee4e358..6d488aea 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -328,7 +328,6 @@ typedef struct qboolean msg_trace; // trace this message void *hInstance; // pointer to game.dll - qboolean config_executed; // should to execute config.cfg once time to restore FCVAR_ARCHIVE that specified in hl.dll edict_t *edicts; // solid array of server entities int numEntities; // actual entities count diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index c2d84e01..9473d79e 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -2455,21 +2455,6 @@ pfnServerExecute void GAME_EXPORT pfnServerExecute( void ) { Cbuf_Execute(); - - if( svgame.config_executed ) - return; - - // here we restore arhcived cvars only from game.dll - host.apply_game_config = true; - Cbuf_AddText( "exec config.cfg\n" ); - Cbuf_Execute(); - - if( host.sv_cvars_restored > 0 ) - Con_Reportf( "server executing ^2config.cfg^7 (%i cvars)\n", host.sv_cvars_restored ); - - host.apply_game_config = false; - svgame.config_executed = true; - host.sv_cvars_restored = 0; } /*