Don't count colors in nickname for <30 char limit

This commit is contained in:
Goodlyay 2018-12-26 20:45:39 -08:00
parent 18938e9ee9
commit 800fe69e5f
3 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ namespace MCGalaxy {
}; };
static string TokenDate(Player p) { return DateTime.Now.ToString("yyyy-MM-dd"); } static string TokenDate(Player p) { return DateTime.Now.ToString("yyyy-MM-dd"); }
static string TokenTime(Player p) { return DateTime.Now.ToString("HH:mm:ss"); } static string TokenTime(Player p) { return DateTime.Now.ToString("hh:mm tt"); }
static string TokenIRC(Player p) { return Server.Config.IRCServer + " > " + Server.Config.IRCChannels; } static string TokenIRC(Player p) { return Server.Config.IRCServer + " > " + Server.Config.IRCChannels; }
static string TokenBanned(Player p) { return Group.BannedRank.Players.Count.ToString(); } static string TokenBanned(Player p) { return Group.BannedRank.Players.Count.ToString(); }
static string TokenServerName(Player p) { return Server.Config.Name; } static string TokenServerName(Player p) { return Server.Config.Name; }

View File

@ -52,7 +52,7 @@ namespace MCGalaxy {
// If a bad word is found anywhere in the word, replace the word // If a bad word is found anywhere in the word, replace the word
int length = words[i].Length; int length = words[i].Length;
words[i] = new String('*', length); words[i] = "&c[&fBlocked&c]&f";
} }
return String.Join(" ", words); return String.Join(" ", words);
} }

View File

@ -61,7 +61,7 @@ namespace MCGalaxy.Commands.Chatting {
Chat.MessageFrom(who, "λNICK %Shad their custom nick reset"); Chat.MessageFrom(who, "λNICK %Shad their custom nick reset");
who.DisplayName = who.truename; who.DisplayName = who.truename;
} else { } else {
if (nick.Length >= 30) { p.Message("Nick must be under 30 letters."); return; } if (Colors.Strip(nick).Length >= 30) { p.Message("Nick must be under 30 letters."); return; }
Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick); Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick);
who.DisplayName = nick; who.DisplayName = nick;