SteamWar/BungeeCore
Archiviert
13
2

Hotfix adding ddos measurement

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-03-08 22:02:56 +01:00
Ursprung 63043ee677
Commit 552e0f3aed

Datei anzeigen

@ -11,6 +11,7 @@ import java.util.logging.LogRecord;
public class ErrorLogger extends Handler implements Filter { public class ErrorLogger extends Handler implements Filter {
private static ErrorLogger instance; private static ErrorLogger instance;
private int ddosRate = 0;
ErrorLogger(){ ErrorLogger(){
ProxyServer.getInstance().getLogger().addHandler(this); ProxyServer.getInstance().getLogger().addHandler(this);
@ -40,6 +41,10 @@ public class ErrorLogger extends Handler implements Filter {
String stacktraceString = stacktrace.toString(); String stacktraceString = stacktrace.toString();
if(stacktraceString.contains("Cannot request protocol")){ if(stacktraceString.contains("Cannot request protocol")){
ddosRate++;
if(ddosRate % 1000 == 0){
SWException.log("Bungee", "DDOS", ddosRate + "");
}
return false; return false;
} }
return true; return true;