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) { void Player_PlayerChat(Player p, string message) {
if (String.IsNullOrEmpty(message.Trim())) { if (String.IsNullOrEmpty(message.Trim())) return;
Player.Message(p, "You cannot send that message");
return;
}
if (!IsConnected()) return; if (!IsConnected()) return;
string name = Server.ircPlayerTitles ? p.FullName : p.group.prefix + p.ColoredName; 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; return;
} }
text = Regex.Replace(text, @"\s\s+", " "); text = Regex.Replace(text, " +", " ");
if ( text.Any(ch => ch == '&') ) { if ( text.Any(ch => ch == '&') ) {
Leave("Illegal character in chat message!", true); Leave("Illegal character in chat message!", true);
return; return;