Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Spigot counter fixed.
Browse files Browse the repository at this point in the history
Former-commit-id: a628e4c
  • Loading branch information
PolskiStevek committed Jan 1, 2020
1 parent ea39575 commit a5e58d6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ public class AttackManager {
private static int joinPerSecond = 0;
private static int connectPerSecond = 0;
private static int pingPerSecond = 0;
private static int totalBots = 0;
private static boolean attackMode = false;

public static int getTotalBots() {
return totalBots;
}

public static boolean isUnderAttack() {
return attackMode;
}
Expand Down Expand Up @@ -56,10 +61,11 @@ public static void handleDetection(String reason, String nick, String adress, As
closeConnection(event, kickReason);
Logger.debug("- " + reason + " - FAILED");
if (getConnectPerSecond() > 5) {
Notificator.title(MessagesBukkit.ATTACK_TITLE.replace("{CPS}", String.valueOf(getConnectPerSecond())), MessagesBukkit.ATTACK_SUBTITLE.replace("{MAX}", String.valueOf(DataFileManager.getBlockedBots())));
Notificator.title(MessagesBukkit.ATTACK_TITLE.replace("{CPS}", String.valueOf(getConnectPerSecond())), MessagesBukkit.ATTACK_SUBTITLE.replace("{MAX}", String.valueOf(getTotalBots())));
}
Notificator.action(MessagesBukkit.ACTIONBAR_ATTACK.replace("{NICK}", nick).replace("{IP}", adress).replace("{DETECTION}", reason));
DataFileManager.blockedBots++;
totalBots++;
}

public static void handleAttack(AttackType type) {
Expand Down

0 comments on commit a5e58d6

Please sign in to comment.