From e613666c1a00d1337ebd9b9cb54a2373b24641dc Mon Sep 17 00:00:00 2001 From: xiaoyv404 Date: Thu, 25 Jul 2024 21:30:56 +0800 Subject: [PATCH] try to fix time --- .../kotlin/com/xiaoyv404/mirai/dao/MinecraftServerPlayer.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/xiaoyv404/mirai/dao/MinecraftServerPlayer.kt b/src/main/kotlin/com/xiaoyv404/mirai/dao/MinecraftServerPlayer.kt index 9e7df4e..507bc1a 100644 --- a/src/main/kotlin/com/xiaoyv404/mirai/dao/MinecraftServerPlayer.kt +++ b/src/main/kotlin/com/xiaoyv404/mirai/dao/MinecraftServerPlayer.kt @@ -2,6 +2,7 @@ package com.xiaoyv404.mirai.dao import com.xiaoyv404.mirai.app.minecraftServer.Player import com.xiaoyv404.mirai.core.MessageProcessor.reply +import com.xiaoyv404.mirai.core.NfClock import com.xiaoyv404.mirai.database.Database import com.xiaoyv404.mirai.model.mincraftServer.MinecraftServer import com.xiaoyv404.mirai.model.mincraftServer.MinecraftServerPlayer @@ -103,8 +104,8 @@ fun MinecraftServer.getOnlinePlayers(): List { fun MinecraftServerPlayer.getAllOnlinePlayers(): List { val players = Database.db.minecraftServerPlayer.filter { - MinecraftServerPlayers.lastLoginTime between (LocalDateTime.now() - .plusMinutes(-4))..(LocalDateTime.now()) + MinecraftServerPlayers.lastLoginTime between (NfClock.now() + .plusMinutes(-4))..(NfClock.now()) }.toList() return players }