conf: remove yb_logger_disable_logfile in favor of custom setting
This commit is contained in:
parent
06c2243d58
commit
f97876d9cf
3 changed files with 25 additions and 17 deletions
|
|
@ -58,3 +58,8 @@ ZMInfectedTeam = T
|
||||||
;
|
;
|
||||||
EnableFakeBotFeatures = no
|
EnableFakeBotFeatures = no
|
||||||
|
|
||||||
|
;
|
||||||
|
; Disables any writing activity to log files. Thus all errors and warnings just
|
||||||
|
; sent to the server console. This replaces yb_logger_disable_logfile cvar.
|
||||||
|
;
|
||||||
|
DisableLogFile = no
|
||||||
|
|
|
||||||
|
|
@ -312,13 +312,6 @@ yb_bind_menu_key "="
|
||||||
//
|
//
|
||||||
yb_ignore_cvars_on_changelevel "yb_quota,yb_autovacate"
|
yb_ignore_cvars_on_changelevel "yb_quota,yb_autovacate"
|
||||||
|
|
||||||
//
|
|
||||||
// Disables logger to write anything to log file. Just spew content to the console.
|
|
||||||
// ---
|
|
||||||
// Default: "0", Min: "0", Max: "1"
|
|
||||||
//
|
|
||||||
yb_logger_disable_logfile "0"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// The value (password) for the setinfo key, if user sets correct password, he's gains access to bot commands and menus.
|
// The value (password) for the setinfo key, if user sets correct password, he's gains access to bot commands and menus.
|
||||||
// ---
|
// ---
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
ConVar cv_bind_menu_key ("bind_menu_key", "=", "Binds specified key for opening bots menu.", false);
|
ConVar cv_bind_menu_key ("bind_menu_key", "=", "Binds specified key for opening bots menu.", false);
|
||||||
ConVar cv_ignore_cvars_on_changelevel ("ignore_cvars_on_changelevel", "yb_quota,yb_autovacate", "Specifies comma separated list of bot cvars, that will not be overwritten by config on changelevel.", false);
|
ConVar cv_ignore_cvars_on_changelevel ("ignore_cvars_on_changelevel", "yb_quota,yb_autovacate", "Specifies comma separated list of bot cvars, that will not be overwritten by config on changelevel.", false);
|
||||||
ConVar cv_logger_disable_logfile ("logger_disable_logfile", "0", "Disables logger to write anything to log file. Just spew content to the console.");
|
|
||||||
|
|
||||||
BotConfig::BotConfig () {
|
BotConfig::BotConfig () {
|
||||||
m_chat.resize (Chat::Count);
|
m_chat.resize (Chat::Count);
|
||||||
|
|
@ -106,6 +105,9 @@ void BotConfig::loadMainConfig (bool isFirstLoad) {
|
||||||
cv_difficulty.set (3);
|
cv_difficulty.set (3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// preload custom config
|
||||||
|
conf.loadCustomConfig ();
|
||||||
|
|
||||||
// bind the correct menu key for bot menu...
|
// bind the correct menu key for bot menu...
|
||||||
if (!game.isDedicated ()) {
|
if (!game.isDedicated ()) {
|
||||||
auto val = cv_bind_menu_key.as <StringRef> ();
|
auto val = cv_bind_menu_key.as <StringRef> ();
|
||||||
|
|
@ -114,9 +116,14 @@ void BotConfig::loadMainConfig (bool isFirstLoad) {
|
||||||
game.serverCommand ("bind \"%s\" \"yb menu\"", val);
|
game.serverCommand ("bind \"%s\" \"yb menu\"", val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static const bool disableLogWrite = conf.fetchCustom ("DisableLogFile").startsWith ("yes");
|
||||||
|
|
||||||
// disable logger if requested
|
// disable logger if requested
|
||||||
logger.disableLogWrite (cv_logger_disable_logfile);
|
logger.disableLogWrite (disableLogWrite);
|
||||||
|
|
||||||
|
if (disableLogWrite) {
|
||||||
|
game.print ("Bot logging is disabled.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BotConfig::loadNamesConfig () {
|
void BotConfig::loadNamesConfig () {
|
||||||
|
|
@ -671,14 +678,17 @@ void BotConfig::loadCustomConfig () {
|
||||||
MemFile file {};
|
MemFile file {};
|
||||||
|
|
||||||
auto setDefaults = [&] () {
|
auto setDefaults = [&] () {
|
||||||
m_custom["C4ModelName"] = "c4.mdl";
|
m_custom = {
|
||||||
m_custom["AMXParachuteCvar"] = "sv_parachute";
|
{ "C4ModelName", "c4.mdl" },
|
||||||
m_custom["CustomCSDMSpawnPoint"] = "view_spawn";
|
{ "AMXParachuteCvar", "sv_parachute" },
|
||||||
m_custom["CSDMDetectCvar"] = "csdm_active";
|
{ "CustomCSDMSpawnPoint", "view_spawn" },
|
||||||
m_custom["ZMDetectCvar"] = "zp_delay";
|
{ "CSDMDetectCvar", "csdm_active" },
|
||||||
m_custom["ZMDelayCvar"] = "zp_delay";
|
{ "ZMDetectCvar", "zp_delay" },
|
||||||
m_custom["ZMInfectedTeam"] = "T";
|
{ "ZMDelayCvar", "zp_delay" },
|
||||||
m_custom["EnableFakeBotFeatures"] = "no";
|
{ "ZMInfectedTeam", "T" },
|
||||||
|
{ "EnableFakeBotFeatures", "no" },
|
||||||
|
{ "DisableLogFile", "no" }
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
setDefaults ();
|
setDefaults ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue