Increase spam threshold to limit false flags
This commit is contained in:
parent
e7f6e8c708
commit
d1f81d8154
@ -23,6 +23,8 @@ import net.minecraft.server.v1_8_R3.PacketPlayInChat;
|
|||||||
|
|
||||||
public class SpamHandler implements IPacketHandler
|
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();
|
private final Cache<String, Integer> _recentChat = CacheBuilder.newBuilder().expireAfterWrite(500, TimeUnit.MILLISECONDS).build();
|
||||||
|
|
||||||
public SpamHandler()
|
public SpamHandler()
|
||||||
@ -66,7 +68,7 @@ public class SpamHandler implements IPacketHandler
|
|||||||
|
|
||||||
_recentChat.put(mapKey, newValue);
|
_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);
|
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;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user