Browse Source

engine: server: GoldSrc compliant pfnServerExecute(), don't execute config.cfg for server!

pull/2/head
Alibek Omarov 2 years ago
parent
commit
0984368a31
  1. 1
      engine/common/common.h
  2. 2
      engine/common/cvar.c
  3. 1
      engine/server/server.h
  4. 15
      engine/server/sv_game.c

1
engine/common/common.h

@ -365,7 +365,6 @@ typedef struct host_parm_s @@ -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;

2
engine/common/cvar.c

@ -1021,8 +1021,6 @@ qboolean Cvar_CommandWithPrivilegeCheck( convar_t *v, qboolean isPrivileged ) @@ -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;
}
}

1
engine/server/server.h

@ -328,7 +328,6 @@ typedef struct @@ -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

15
engine/server/sv_game.c

@ -2455,21 +2455,6 @@ pfnServerExecute @@ -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;
}
/*

Loading…
Cancel
Save