From: havoc Date: Mon, 17 Oct 2011 17:07:41 +0000 (+0000) Subject: added sv_disablenotify cvar (default 1) to suppress prints about X-Git-Tag: xonotic-v0.6.0~163^2~119 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8cabb44fef43e034df597cf69427d444203f3719;p=xonotic%2Fdarkplaces.git added sv_disablenotify cvar (default 1) to suppress prints about CVAR_NOTIFY cvars changing git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11438 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cvar.c b/cvar.c index f7cc77bb..8cc14f09 100644 --- a/cvar.c +++ b/cvar.c @@ -318,6 +318,7 @@ void Cvar_UpdateAllAutoCvars(void) Cvar_Set ============ */ +extern cvar_t sv_disablenotify; void Cvar_SetQuick_Internal (cvar_t *var, const char *value) { qboolean changed; @@ -341,7 +342,7 @@ void Cvar_SetQuick_Internal (cvar_t *var, const char *value) memcpy ((char *)var->string, value, valuelen + 1); var->value = atof (var->string); var->integer = (int) var->value; - if ((var->flags & CVAR_NOTIFY) && changed && sv.active) + if ((var->flags & CVAR_NOTIFY) && changed && sv.active && !sv_disablenotify.integer) SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", var->name, var->string); #if 0 // TODO: add infostring support to the server? diff --git a/sv_main.c b/sv_main.c index db86c8f0..a223b7c5 100644 --- a/sv_main.c +++ b/sv_main.c @@ -39,6 +39,7 @@ cvar_t sv_worldname = {CVAR_READONLY, "sv_worldname", "", "name of current world cvar_t sv_worldnamenoextension = {CVAR_READONLY, "sv_worldnamenoextension", "", "name of current worldmodel without extension"}; cvar_t sv_worldbasename = {CVAR_READONLY, "sv_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"}; +cvar_t sv_disablenotify = {0, "sv_disablenotify", "1", "suppress broadcast prints when certain cvars are changed (CVAR_NOTIFY flag in engine code)"}; cvar_t coop = {0, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"}; cvar_t deathmatch = {0, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"}; cvar_t fraglimit = {CVAR_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"}; @@ -449,6 +450,7 @@ void SV_Init (void) Cmd_AddCommand_WithClientCommand("sv_startdownload", NULL, SV_StartDownload_f, "begins sending a file to the client (network protocol use only)"); Cmd_AddCommand_WithClientCommand("download", NULL, SV_Download_f, "downloads a specified file from the server"); + Cvar_RegisterVariable (&sv_disablenotify); Cvar_RegisterVariable (&coop); Cvar_RegisterVariable (&deathmatch); Cvar_RegisterVariable (&fraglimit);