From 22e8d4dc45e799cdac563385a6562c5a204b7154 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 27 Apr 2019 21:26:46 +1000 Subject: [PATCH] Make sure names aren't truncated to 0 length on old servers and increase the soft limit of name lengths to 64 (not including colour codes) --- qcsrc/server/client.qc | 2 +- xonotic-server.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6f3fca9fc..1bb51fdb7 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2397,7 +2397,7 @@ void PlayerPreThink (entity this) if (this.netname == "" || this.netname != CS(this).netname_previous) { bool assume_unchanged = (CS(this).netname_previous == ""); - if (strlennocol(this.netname) > autocvar_name_maxlength) + if (autocvar_name_maxlength > 0 && 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")); diff --git a/xonotic-server.cfg b/xonotic-server.cfg index db36db5b7..d66662749 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -2,7 +2,7 @@ // 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" +set name_maxlength 64 "max player name length (not counting color codes) allowed by the server" // taunts and voices set sv_taunt 1 "allow taunts on the server" -- 2.39.2