Fix banneduserips
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-02-25 07:35:32 +01:00
Ursprung ec9d56dab9
Commit 3a8df67f19

Datei anzeigen

@ -27,6 +27,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.Instant;
import java.util.List; import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@ -36,7 +37,7 @@ public class BannedUserIPs {
private static final SelectStatement<BannedUserIPs> getByID = table.selectFields("UserID"); private static final SelectStatement<BannedUserIPs> getByID = table.selectFields("UserID");
private static final SelectStatement<BannedUserIPs> getByIP = new SelectStatement<>(table, "SELECT * FROM BannedUserIPs WHERE IP = ? ORDER BY Timestamp DESC"); private static final SelectStatement<BannedUserIPs> 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"); private static final Statement unbanIPs = table.deleteFields("UserID");
@Getter @Getter
@ -57,7 +58,7 @@ public class BannedUserIPs {
} }
public static void banIP(int userID, String ip){ 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) { public static void unbanIPs(int userID) {