From 552e0f3aedfd8ca5c242d2dd99839f57507bce8c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 8 Mar 2020 22:02:56 +0100 Subject: [PATCH] Hotfix adding ddos measurement Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ErrorLogger.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/de/steamwar/bungeecore/ErrorLogger.java b/src/de/steamwar/bungeecore/ErrorLogger.java index 829317f9..64ebcc19 100644 --- a/src/de/steamwar/bungeecore/ErrorLogger.java +++ b/src/de/steamwar/bungeecore/ErrorLogger.java @@ -11,6 +11,7 @@ import java.util.logging.LogRecord; public class ErrorLogger extends Handler implements Filter { private static ErrorLogger instance; + private int ddosRate = 0; ErrorLogger(){ ProxyServer.getInstance().getLogger().addHandler(this); @@ -40,6 +41,10 @@ public class ErrorLogger extends Handler implements Filter { String stacktraceString = stacktrace.toString(); if(stacktraceString.contains("Cannot request protocol")){ + ddosRate++; + if(ddosRate % 1000 == 0){ + SWException.log("Bungee", "DDOS", ddosRate + ""); + } return false; } return true;