diff --git a/MinecraftClient/ChatBots/RemoteControl.cs b/MinecraftClient/ChatBots/RemoteControl.cs
index 300beb02..9bf038df 100644
--- a/MinecraftClient/ChatBots/RemoteControl.cs
+++ b/MinecraftClient/ChatBots/RemoteControl.cs
@@ -19,6 +19,11 @@ namespace MinecraftClient.ChatBots
{
string response = "";
PerformInternalCommand(command, ref response);
+ response = GetVerbatim(response);
+ foreach (char disallowedChar in McClient.GetDisallowedChatCharacters())
+ {
+ response = response.Replace(disallowedChar.ToString(), String.Empty);
+ }
if (response.Length > 0)
{
SendPrivateMessage(sender, response);
diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs
index 27ed6346..1ba43f6e 100644
--- a/MinecraftClient/McClient.cs
+++ b/MinecraftClient/McClient.cs
@@ -735,6 +735,15 @@ namespace MinecraftClient
}
}
+ ///
+ /// Get a list of disallowed characters in chat
+ ///
+ ///
+ public static char[] GetDisallowedChatCharacters()
+ {
+ return new char[] { (char)167, (char)127 }; // Minecraft color code and ASCII code DEL
+ }
+
#region Management: Load/Unload ChatBots and Enable/Disable settings
///
@@ -1021,6 +1030,8 @@ namespace MinecraftClient
{
lock (chatQueue)
{
+ if (String.IsNullOrEmpty(text))
+ return;
int maxLength = handler.GetMaxChatMessageLength();
if (text.Length > maxLength) //Message is too long?
{