Engine: separate server and client offline configuration files

Dedicated server or Client only builds will warn to the console if something is trying to set a convar, or execute a concommand that doesn't exist. Dedicated server builds don't have client commands/convars, and visa versa.
This commit is contained in:
Kawe Mazidjatari 2024-11-14 15:49:57 +01:00
parent 3d5ddd2bed
commit 14e0c8f5e4
4 changed files with 26 additions and 5 deletions

View File

@ -423,7 +423,12 @@ void CHostState::LoadConfig(void) const
}
if (CommandLine()->CheckParm("-offline"))
{
Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec system/autoexec_offline.cfg\n", cmd_source_t::kCommandSrcCode);
#ifndef CLIENT_DLL
Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec system/offline_server.cfg\n", cmd_source_t::kCommandSrcCode);
#endif //!CLIENT_DLL
#ifndef DEDICATED
Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec system/offline_client.cfg\n", cmd_source_t::kCommandSrcCode);
#endif // !DEDICATED
}
#ifndef CLIENT_DLL
Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec liveapi.cfg\n", cmd_source_t::kCommandSrcCode);

View File

@ -22,6 +22,7 @@ del /Q "%~dp0..\platform\cfg\englishclient_build_vpk.cfg"
del /Q "%~dp0..\platform\cfg\englishclient_extract_vpk.cfg"
del /Q "%~dp0..\platform\cfg\englishserver_build_vpk.cfg"
del /Q "%~dp0..\platform\cfg\englishserver_extract_vpk.cfg"
del /Q "%~dp0..\platform\cfg\system\autoexec_offline.cfg"
del /Q "%~dp0..\platform\cfg\system\launcher.vdf"
del /Q "%~dp0..\platform\cfg\system\keymap.vdf"
del /Q "%~dp0..\platform\cfg\system\layout.ini"

View File

@ -0,0 +1,16 @@
/////////////////////// offline_client configuration file.
// This file is executed automatically on startup when the
// '-offline' parameter is passed to the application.
// Do not authenticate with the master servers.
cl_onlineAuthEnable "0"
// Do not send crash logs.
backtrace_enabled "0"
// Disable matchmaking.
pylon_matchmaking_enabled "0"
// Set a name as this would otherwise be empty, the server
// will reject us if our name is empty or invalid.
cl_setname "unnamed"

View File

@ -1,10 +1,9 @@
/////////////////////// offline configuration file.
// This file is executed automatically on startup
// when '-offline' is passed to the application.
/////////////////////// offline_client configuration file.
// This file is executed automatically on startup when the
// '-offline' parameter is passed to the application.
// Do not authenticate with the master servers.
sv_onlineAuthEnable "0"
cl_onlineAuthEnable "0"
// Do not send crash logs.
backtrace_enabled "0"