Fix double emotes (control characters, such as single music note) being incorrectly trimmed to a single emote by chat regex.

This commit is contained in:
UnknownShadow200 2016-06-16 11:57:32 +10:00
parent 4a31395a06
commit e2720274d3
2 changed files with 2 additions and 5 deletions

View File

@ -215,10 +215,7 @@ namespace MCGalaxy {
}
void Player_PlayerChat(Player p, string message) {
if (String.IsNullOrEmpty(message.Trim())) {
Player.Message(p, "You cannot send that message");
return;
}
if (String.IsNullOrEmpty(message.Trim())) return;
if (!IsConnected()) return;
string name = Server.ircPlayerTitles ? p.FullName : p.group.prefix + p.ColoredName;

View File

@ -991,7 +991,7 @@ try { SendBlockchange(pos1.x, pos1.y, pos1.z, Block.waterstill); } catch { }
return;
}
text = Regex.Replace(text, @"\s\s+", " ");
text = Regex.Replace(text, " +", " ");
if ( text.Any(ch => ch == '&') ) {
Leave("Illegal character in chat message!", true);
return;