diff --git a/src/main/java/app/entities/server/PlayOn.java b/src/main/java/app/entities/server/PlayOn.java index a2187c9..d1926f1 100644 --- a/src/main/java/app/entities/server/PlayOn.java +++ b/src/main/java/app/entities/server/PlayOn.java @@ -1,5 +1,6 @@ package app.entities.server; +import app.utils.CryptedCookie; import lombok.AllArgsConstructor; import lombok.Data; @@ -19,4 +20,8 @@ public class PlayOn { return ip; } } + + public String getIp(CryptedCookie cryptedCookie) { + return cryptedCookie.ReadCh(ip).split(":",2)[0]; + } } diff --git a/src/main/java/app/services/db/BanService.java b/src/main/java/app/services/db/BanService.java index 6cc8f8f..2f0e14d 100644 --- a/src/main/java/app/services/db/BanService.java +++ b/src/main/java/app/services/db/BanService.java @@ -85,7 +85,7 @@ public class BanService { .setParameter(4, ban_reason) .setParameter(5, admin.getSteamids().steam2) .setParameter(6, 1) - .setParameter(7, user.getPlay_on() != null ? user.getPlay_on().getIp() : "") + .setParameter(7, user.getPlay_on() != null ? user.getPlay_on().getIp(cryptedCookie) : "") .setParameter(8, user.getPlay_on() != null ? user.getPlay_on().getName() : user.getSteam_data().getNickname()) .setParameter(9, admin.getSteam_data().getNickname()) .executeUpdate(); @@ -98,4 +98,12 @@ public class BanService { .setParameter(1,1) .getResultList(); } + + public String deCrypt(String crypted) { + try { + return cryptedCookie.ReadCh(crypted); + } catch (Exception e) { + return crypted; + } + } }