+ else if ((var->flags & CVAR_NQUSERINFOHACK) && cls.state != ca_dedicated)
+ {
+ // update the cls.userinfo to have proper values for the
+ // silly nq config variables.
+ //
+ // this is done when these variables are changed rather than at
+ // connect time because if the user or code checks the userinfo and it
+ // holds weird values it may cause confusion...
+ if (!strcmp(var->name, "_cl_color"))
+ {
+ int top = (var->integer >> 4) & 15, bottom = var->integer & 15;
+ CL_SetInfo("topcolor", va("%i", top), true, false, false, false);
+ CL_SetInfo("bottomcolor", va("%i", bottom), true, false, false, false);
+ if (cls.protocol != PROTOCOL_QUAKEWORLD && cls.netcon)
+ {
+ MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+ MSG_WriteString(&cls.netcon->message, va("color %i %i", top, bottom));
+ }
+ }
+ else if (!strcmp(var->name, "_cl_rate"))
+ CL_SetInfo("rate", va("%i", var->integer), true, false, false, false);
+ else if (!strcmp(var->name, "_cl_playerskin"))
+ CL_SetInfo("playerskin", var->string, true, false, false, false);
+ else if (!strcmp(var->name, "_cl_playermodel"))
+ CL_SetInfo("playermodel", var->string, true, false, false, false);
+ else if (!strcmp(var->name, "_cl_name"))
+ CL_SetInfo("name", var->string, true, false, false, false);
+ else if (!strcmp(var->name, "rcon_secure"))
+ {
+ // whenever rcon_secure is changed to 0, clear rcon_password for
+ // security reasons (prevents a send-rcon-password-as-plaintext
+ // attack based on NQ protocol session takeover and svc_stufftext)
+ if(var->integer <= 0)
+ Cvar_Set("rcon_password", "");
+ }
+ else if (!strcmp(var->name, "net_slist_favorites"))
+ NetConn_UpdateFavorites();
+ }