From 3a8df67f197748e24921f69a1c1c77ac6528ce05 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Feb 2023 07:35:32 +0100 Subject: [PATCH] Fix banneduserips Signed-off-by: Lixfel --- src/de/steamwar/sql/BannedUserIPs.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/sql/BannedUserIPs.java b/src/de/steamwar/sql/BannedUserIPs.java index 9a31099..f582817 100644 --- a/src/de/steamwar/sql/BannedUserIPs.java +++ b/src/de/steamwar/sql/BannedUserIPs.java @@ -27,6 +27,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import java.sql.Timestamp; +import java.time.Instant; import java.util.List; @AllArgsConstructor @@ -36,7 +37,7 @@ public class BannedUserIPs { private static final SelectStatement getByID = table.selectFields("UserID"); private static final SelectStatement getByIP = new SelectStatement<>(table, "SELECT * FROM BannedUserIPs WHERE IP = ? ORDER BY Timestamp DESC"); - private static final Statement banIP = table.insert(Table.PRIMARY); + private static final Statement banIP = table.insertAll(); private static final Statement unbanIPs = table.deleteFields("UserID"); @Getter @@ -57,7 +58,7 @@ public class BannedUserIPs { } public static void banIP(int userID, String ip){ - banIP.update(userID, ip); + banIP.update(userID, Timestamp.from(Instant.now()), ip); } public static void unbanIPs(int userID) {