Skip to content

Commit

Permalink
Merge pull request #144 from xiaoyv404/develop
Browse files Browse the repository at this point in the history
try to fix time
  • Loading branch information
xiaoyv404 authored Jul 25, 2024
2 parents 60633f0 + e613666 commit 2ac170a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -103,8 +104,8 @@ fun MinecraftServer.getOnlinePlayers(): List<MinecraftServerPlayer> {
fun MinecraftServerPlayer.getAllOnlinePlayers(): List<MinecraftServerPlayer> {
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
}

0 comments on commit 2ac170a

Please sign in to comment.