mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Add fine info to spam check
This commit is contained in:
1 parent
14aa2a8905
commit
b735a37663
4 files changed
+12
-4
No files matched your search
@@ -766,8 +766,10 @@ public class Backend {
|
||||
break;
|
||||
} else {
|
||||
if (manager.getConfiguration().getConfig().blockChatSpamRepetition.getValue() && m.equalsIgnoreCase(msg) && i == 1) {
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " spam-repeated \"" + msg + "\"");
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.spamWarning.getValue());
|
||||
} else if (manager.getConfiguration().getConfig().blockChatSpamSpeed.getValue() && System.currentTimeMillis() - user.getLastCommandTime() < magic.COMMAND_MIN * 2) {
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " spammed quickly \"" + msg + "\"");
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.spamWarning.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class CommandHelp extends CommandBase {
|
||||
GRAY + "/anti " + AQUA + "reload",
|
||||
GRAY + "/anti " + AQUA + "update",
|
||||
GRAY + "/anti " + AQUA + "debug " + AQUA + "<user>",
|
||||
GRAY + "/anti " + AQUA + "check " + GOLD + "[check] [on/off]",
|
||||
GRAY + "/anti " + AQUA + "log " + GOLD + "[file/console] [on/off]",
|
||||
GRAY + "/anti " + AQUA + "report " + GOLD + "[group/user]",
|
||||
GRAY + "/anti " + AQUA + "reload",
|
||||
|
||||
@@ -54,7 +54,7 @@ public class CheckManager {
|
||||
*/
|
||||
public void activateCheck(CheckType type, String className) {
|
||||
if (!isActive(type)) {
|
||||
manager.getLoggingManager().logToFile("The " + type.toString() + " check was activated by " + className + ".");
|
||||
manager.getLoggingManager().logFineInfo("The " + type.toString() + " check was activated by " + className + ".");
|
||||
checkIgnoreList.remove(type);
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class CheckManager {
|
||||
*/
|
||||
public void deactivateCheck(CheckType type, String className) {
|
||||
if (isActive(type)) {
|
||||
manager.getLoggingManager().logToFile("The " + type.toString() + " check was deactivated by " + className + ".");
|
||||
manager.getLoggingManager().logFineInfo("The " + type.toString() + " check was deactivated by " + className + ".");
|
||||
checkIgnoreList.add(type);
|
||||
disabled++;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class CheckManager {
|
||||
if (!exemptList.containsKey(player.getName())) {
|
||||
exemptList.put(player.getName(), new ArrayList<CheckType>());
|
||||
}
|
||||
manager.getLoggingManager().logToFile(player.getName() + " was exempted from the " + type.toString() + " check by " + className + ".");
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " was exempted from the " + type.toString() + " check by " + className + ".");
|
||||
exemptList.get(player.getName()).add(type);
|
||||
exempt++;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class CheckManager {
|
||||
*/
|
||||
public void unexemptPlayer(Player player, CheckType type, String className) {
|
||||
if (isExempt(player, type)) {
|
||||
manager.getLoggingManager().logToFile(player.getName() + " was unexempted from the " + type.toString() + " check by " + className + ".");
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " was unexempted from the " + type.toString() + " check by " + className + ".");
|
||||
exemptList.get(player.getName()).remove(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@ public class LoggingManager {
|
||||
fileLogger.info(message);
|
||||
}
|
||||
|
||||
public void logFineInfo(String message) {
|
||||
logToFile(message);
|
||||
logToLogs(message);
|
||||
}
|
||||
|
||||
public void logToPlayers(String message) {
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (Permission.SYSTEM_NOTICE.get(player)) {
|
||||
|
||||
Reference in new issue
Block a user