Archiviert
1
0

Fixing BannedUserIp Delete

Dieser Commit ist enthalten in:
Chaoscaot 2020-11-15 13:04:31 +01:00
Ursprung 4dd593243e
Commit 5ee2d10308
2 geänderte Dateien mit 5 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -47,15 +47,6 @@ public class BanListener extends BasicListener {
List<BannedUserIPs> ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress());
if(!ips.isEmpty()){
if(ips.stream().anyMatch(bannedUserIPs -> bannedUserIPs.getUserID() == user.getId())) {
ips.forEach(bannedUserIPs -> {
if(bannedUserIPs.getUserID() == user.getId())
bannedUserIPs.remove();
});
ips.removeIf(bannedUserIPs -> bannedUserIPs.getUserID() == user.getId());
if(ips.isEmpty())
return;
}
StringBuilder potentialBan = new StringBuilder();
potentialBan.append(BungeeCore.CHAT_PREFIX);
potentialBan.append("§cMögliche Bannumgehung durch §r");

Datei anzeigen

@ -151,7 +151,11 @@ public class SteamwarUser {
public boolean isBanned() {
if(!punishments.containsKey(Punishment.PunishmentType.Ban))
return false;
return isCurrent(punishments.get(Punishment.PunishmentType.Ban));
if(!isCurrent(punishments.get(Punishment.PunishmentType.Ban))) {
SQL.update("DELETE FROM BannedUserIPs WHERE UserID = ?", id);
return false;
}
return true;
}
public boolean isMuted(){