SteamWar/BungeeCore
Archiviert
13
2

Fix bannumgehungs timings #161

Manuell gemergt
Lixfel hat 1 Commits von bannumgehungs-fix nach master 2020-12-19 12:22:19 +01:00 zusammengeführt
Nur Änderungen aus Commit a5dc11cac1 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -33,7 +33,6 @@ import net.md_5.bungee.api.event.LoginEvent;
import net.md_5.bungee.event.EventHandler;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.List;
@ -52,7 +51,7 @@ public class BanListener extends BasicListener {
List<BannedUserIPs> ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress());
if(!ips.isEmpty()){
Timestamp highestBan = Timestamp.from(Instant.now());
Timestamp highestBan = ips.get(0).getTimestamp();
for(BannedUserIPs banned : ips) {
if(highestBan.before(banned.getTimestamp()))
highestBan = banned.getTimestamp();
@ -70,8 +69,8 @@ public class BanListener extends BasicListener {
for(BannedUserIPs banned : ips) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getId(),
banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT), bannedUser.getUserName()));
potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getUserName(),
banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT)));
}
TextComponent msg = new TextComponent(potentialBan.toString());