From 9642cbe2f4555ec1be8ed1f2ac489c6300fbcc35 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Fri, 10 Feb 2012 19:34:10 +0100 Subject: [PATCH] Remove colors of player messages from log messages --- src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java | 3 ++- src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java index bfcae273..61224934 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ChatCheck.java @@ -23,7 +23,8 @@ public abstract class ChatCheck extends Check { public String getParameter(ParameterName wildcard, NoCheatPlayer player) { if(wildcard == ParameterName.TEXT) - return getData(player.getDataStore()).message; + // Filter colors from the players message when logging + return getData(player.getDataStore()).message.replaceAll("\302\247.", "").replaceAll("\247.", ""); else return super.getParameter(wildcard, player); } diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java index 25ca3bb5..88c6afad 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java @@ -24,7 +24,7 @@ public class ColorCheck extends ChatCheck { if(filter) { // Remove color codes - data.message = data.message.replaceAll("\302\247", "").replaceAll("\247", ""); + data.message = data.message.replaceAll("\302\247.", "").replaceAll("\247.", ""); } }