Add disable broadcast

Prevents public embarassment. Some anarchy server owners like myself want to kick those who have certain hacks but don't want their kick to be publicly known.
This commit is contained in:
Gabriel Curtiss committed 2020-09-13 23:39:01 -05:00
1 parent 3b9b39c49a
commit ef5b4069ce
4 files changed
+7 -3

No files matched your search

@@ -36,6 +36,7 @@ public class Config extends ConfigurationFile {
public ConfigValue<Boolean> eventChains;
public ConfigValue<Boolean> enterprise;
public ConfigValue<Boolean> debugMode;
public ConfigValue<Boolean> disableBroadcast;
public ConfigValue<Boolean> blockChatSpamSpeed;
public ConfigValue<Boolean> blockCommandSpamSpeed;
@@ -67,6 +68,7 @@ public class Config extends ConfigurationFile {
eventChains = new ConfigValue<Boolean>("system.event-chains");
enterprise = new ConfigValue<Boolean>("system.enterprise");
debugMode = new ConfigValue<Boolean>("system.debug-mode");
disableBroadcast = new ConfigValue<Boolean>("system.disable-broadcast");
blockChatSpamSpeed = new ConfigValue<Boolean>("spam.chat.block-speed");
blockChatSpamRepetition = new ConfigValue<Boolean>("spam.chat.block-repetition");
@@ -86,7 +88,6 @@ public class Config extends ConfigurationFile {
if (notifyEveryVl.getValue() < 1) {
notifyEveryVl.setValue(5);
}
maxSetbackDistance = new ConfigValue<Integer>("system.max-setback-distance");
if (maxSetbackDistance.getValue() < 5) {
maxSetbackDistance.setValue(50);
@@ -89,6 +89,7 @@ public class LoggingManager {
}
public void logToPlayers(String message) {
if(!config.getConfig().disableBroadcast.getValue()) return;
for(Player player : Bukkit.getOnlinePlayers()) {
if (Permission.SYSTEM_NOTICE.get(player)) {
player.sendMessage(message);
@@ -96,7 +97,7 @@ public class LoggingManager {
}
}
private void logToLogs(String message) { // Yo dawg
private void logToLogs(String message) { // Yo dawg, you like logs?
logs.add(ChatColor.stripColor(message));
}
@@ -210,7 +210,7 @@ public class UserManager {
user.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', kickReason));
AntiCheatReloaded.getPlugin().onPlayerKicked();
String msg = ChatColor.translateAlternateColorCodes('&', config.getLang().KICK_BROADCAST().replaceAll("%player%", name) + " (" + type.getName() + ")");
if (!msg.equals("")) {
if (!msg.equals("") && config.getConfig().disableBroadcast.getValue()) {
manager.log(msg);
manager.playerLog(msg);
}
+2
View File
@@ -24,6 +24,8 @@ system:
# If silent mode is on, players will not be stopped when they try to hack, and AntiCheatReloaded will do everything possible to keep them unaware of their rising hack level.
# However, alerts will still be sent to console and to admins online, and events will still take place.
silent-mode: false
# Disable broadcasts about why a player was kicked.
disable-broadcast: false
# Should ops be exempt from all checks?
exempt-op: false
# Should AntiCheatReloaded track plugins in its own registered events?