Merge pull request 'Badlion disabling' (#109) from banTests into master
Reviewed-by: Chaoscaot <chaoscaot444@gmail.com> Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
a13e80cc24
38
src/de/steamwar/bungeecore/listeners/mods/Badlion.java
Normale Datei
38
src/de/steamwar/bungeecore/listeners/mods/Badlion.java
Normale Datei
@ -0,0 +1,38 @@
|
||||
package de.steamwar.bungeecore.listeners.mods;
|
||||
|
||||
import de.steamwar.bungeecore.listeners.BasicListener;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
public class Badlion extends BasicListener {
|
||||
|
||||
@EventHandler
|
||||
public void onPostLogin(PostLoginEvent event) {
|
||||
/*
|
||||
{
|
||||
"Clear Glass":{"disabled":true},
|
||||
"ClearWater":{"disabled":true},
|
||||
"FOV Changer":{"disabled":true},
|
||||
"Hitboxes":{"disabled":true},
|
||||
"MiniMap":{"disabled":true},
|
||||
"MLG Cobweb":{"disabled":true},
|
||||
"Replay":{"disabled":true},
|
||||
"Schematica":{"disabled":true},
|
||||
"ToggleSneak":{"disabled":true},
|
||||
"ToggleSprint":{"disabled":true}
|
||||
}
|
||||
*/
|
||||
event.getPlayer().sendData("badlion:mods", ("{" +
|
||||
"\"Clear Glass\":{\"disabled\":true}," +
|
||||
"\"ClearWater\":{\"disabled\":true}," +
|
||||
"\"FOV Changer\":{\"disabled\":true}," +
|
||||
"\"Hitboxes\":{\"disabled\":true}," +
|
||||
"\"MiniMap\":{\"disabled\":true}," +
|
||||
"\"MLG Cobweb\":{\"disabled\":true}," +
|
||||
"\"Replay\":{\"disabled\":true}," +
|
||||
"\"Schematica\":{\"disabled\":true}," +
|
||||
"\"ToggleSneak\":{\"disabled\":true}," +
|
||||
"\"ToggleSprint\":{\"disabled\":true}" +
|
||||
"}").getBytes());
|
||||
}
|
||||
}
|
@ -30,6 +30,7 @@ import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
class Utils {
|
||||
private Utils(){}
|
||||
@ -72,16 +73,20 @@ class Utils {
|
||||
if(mods.size() == 1){
|
||||
if(max == ModType.YELLOW)
|
||||
player.disconnect(BungeeCore.stringToText("§7Deaktiviere den Mod §e" + mods.get(0).getModName() + "§7, um weiter auf §eSteam§8War §7spielen zu können."));
|
||||
else
|
||||
user.ban(Timestamp.from(Instant.now().plus(1, ChronoUnit.DAYS)), "Versuchte Benutzung des Mods " + mods.get(0).getModName());
|
||||
else{
|
||||
user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung des Mods " + mods.get(0).getModName());
|
||||
BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen des Mods " + mods.get(0).getModName() + " gebannt.");
|
||||
}
|
||||
}else{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
mods.forEach(mod -> sb.append(mod.getModName()).append('\n'));
|
||||
|
||||
if(max == ModType.YELLOW)
|
||||
player.disconnect(BungeeCore.stringToText("§7Deaktiviere die Mods\n§e" + sb.toString() + "§7um weiter auf §eSteam§8War §7spielen zu können."));
|
||||
else
|
||||
user.ban(Timestamp.from(Instant.now().plus(1, ChronoUnit.DAYS)), "Versuchte Benutzung der Mods\n" + sb.toString());
|
||||
else{
|
||||
user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung der Mods\n" + sb.toString());
|
||||
BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen der Mods " + sb.toString() + " gebannt.");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren