int autocvar_leadlimit_override;
int autocvar_minplayers;
int autocvar_minplayers_per_team;
+int autocvar_name_maxlength;
string autocvar_nextmap;
string autocvar_quit_and_redirect;
float autocvar_quit_and_redirect_timer;
if (this.netname == "" || this.netname != CS(this).netname_previous)
{
bool assume_unchanged = (CS(this).netname_previous == "");
+ if (strlennocol(this.netname) > autocvar_name_maxlength)
+ {
+ int new_length = textLengthUpToLength(this.netname, autocvar_name_maxlength, strlennocol);
+ this.netname = strzone(strcat(substring(this.netname, 0, new_length), "^7"));
+ sprint(this, sprintf("Warning: your name is longer than %d characters, it has been truncated.\n", autocvar_name_maxlength));
+ assume_unchanged = false;
+ // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
+ }
if (isInvisibleString(this.netname))
{
this.netname = strzone(sprintf("Player#%d", this.playerid));
+ sprint(this, "Warning: invisible names are not allowed.\n");
assume_unchanged = false;
// stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
}
// note that it doesn't reset all server cvars,
// some are shared with the client and so are left in xonotic-common.cfg
+set name_maxlength 30 "max player name length (not counting color codes) allowed by the server"
// taunts and voices
set sv_taunt 1 "allow taunts on the server"