Fix bannumgehungs timings #161
@ -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());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren