From 48eeca06c51ca39b221b76a1281caf36c87bb6b0 Mon Sep 17 00:00:00 2001 From: gsd Date: Mon, 23 Oct 2023 19:11:21 +0300 Subject: [PATCH] =?UTF-8?q?=D1=85=D0=B5=D1=85=D0=B5=20=D0=B3=D0=BE=D0=B2?= =?UTF-8?q?=D0=BD=D1=8F=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/app/entities/server/PlayOn.java | 5 +++++ src/main/java/app/services/db/BanService.java | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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; + } + } }