mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 15:36:27 +01:00
Check if habbo != null when applying wordFilter && use habbo when filtering bot texts/name
This commit is contained in:
parent
2897b24917
commit
495cb137c4
@ -125,7 +125,7 @@ public class WordFilter {
|
||||
|
||||
public String filter(String message, Habbo habbo) {
|
||||
String filteredMessage = message;
|
||||
if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER)) {
|
||||
if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || (habbo != null && habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER))) {
|
||||
return message;
|
||||
}
|
||||
if (Emulator.getConfig().getBoolean("hotel.wordfilter.normalise")) {
|
||||
|
@ -71,7 +71,7 @@ public class CommandBotEvent extends MessageHandler {
|
||||
count++;
|
||||
}
|
||||
|
||||
String result = Emulator.getGameEnvironment().getWordFilter().filter(s, null);
|
||||
String result = Emulator.getGameEnvironment().getWordFilter().filter(s, this.client.getHabbo());
|
||||
|
||||
if (!result.isEmpty()) {
|
||||
if (!this.client.getHabbo().hasPermission(Permission.ACC_CHAT_NO_FILTER)) {
|
||||
@ -117,7 +117,7 @@ public class CommandBotEvent extends MessageHandler {
|
||||
String name = this.packet.readString();
|
||||
boolean invalidName = name.length() > BotManager.MAXIMUM_NAME_LENGTH || name.contains("<") || name.contains(">");
|
||||
if (!invalidName) {
|
||||
String filteredName = Emulator.getGameEnvironment().getWordFilter().filter(name, null);
|
||||
String filteredName = Emulator.getGameEnvironment().getWordFilter().filter(name, this.client.getHabbo());
|
||||
invalidName = !name.equalsIgnoreCase(filteredName);
|
||||
if (!invalidName) {
|
||||
BotSavedNameEvent nameEvent = new BotSavedNameEvent(bot, name);
|
||||
|
Loading…
Reference in New Issue
Block a user