Increase spam threshold to limit false flags

This commit is contained in:
AlexTheCoder 2017-11-22 21:34:45 -05:00 committed by Alexander Meech
parent e7f6e8c708
commit d1f81d8154

View File

@ -23,6 +23,8 @@ import net.minecraft.server.v1_8_R3.PacketPlayInChat;
public class SpamHandler implements IPacketHandler
{
private static final int DETECTION_THRESHOLD = 30;
private final Cache<String, Integer> _recentChat = CacheBuilder.newBuilder().expireAfterWrite(500, TimeUnit.MILLISECONDS).build();
public SpamHandler()
@ -66,7 +68,7 @@ public class SpamHandler implements IPacketHandler
_recentChat.put(mapKey, newValue);
if (newValue >= 10)
if (newValue >= DETECTION_THRESHOLD)
{
SlackAPI.getInstance().sendMessage(SlackTeam.DEVELOPER, "#spam-alert", new SlackMessage("Spambot Alert System", "heavy_exclamation_mark", "A spambot threat was detected on " + UtilServer.getRegion().name() + " " + UtilServer.getServerName() + ": MSG=\"" + message + "\" & OCCURRENCES=" + newValue), true);
return true;