From cb9716e7b04f9b9e23426368f6f65bfb8048f11c Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Mon, 17 Jun 2024 14:51:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=95=B0=E6=8D=AE=E5=BA=93=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/cn/lunadeer/essentialsd/dtos/LoginRecord.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c52c71c..495d7b1 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.lunadeer EssentialsD - 1.22.0 + 1.22.1 jar EssentialsD diff --git a/src/main/java/cn/lunadeer/essentialsd/dtos/LoginRecord.java b/src/main/java/cn/lunadeer/essentialsd/dtos/LoginRecord.java index ba4a11a..716edbb 100644 --- a/src/main/java/cn/lunadeer/essentialsd/dtos/LoginRecord.java +++ b/src/main/java/cn/lunadeer/essentialsd/dtos/LoginRecord.java @@ -6,6 +6,7 @@ import org.bukkit.entity.Player; import java.net.InetSocketAddress; import java.sql.ResultSet; +import java.sql.Timestamp; import java.util.UUID; public class LoginRecord { @@ -32,8 +33,8 @@ public class LoginRecord { } else { ip = address.getAddress().getHostAddress(); } - long login_time = player.getLastLogin(); - long logout_time = System.currentTimeMillis(); + Timestamp login_time = new Timestamp(player.getLastLogin()); + Timestamp logout_time = new Timestamp(System.currentTimeMillis()); String logout_location = LocationUtils.Serialize(player.getLocation()); String sql = "INSERT INTO login_record (uuid, ip, login_time, logout_location, logout_time) " + "VALUES (?, ?, ?, ?, ?);";