Hotfix adding ddos measurement
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
63043ee677
Commit
552e0f3aed
@ -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;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren