类 PlayerTimeApi
java.lang.Object
cn.handyplus.time.api.PlayerTimeApi
-
方法概要
修饰符和类型方法说明static longgetSecond(UUID playerUuid, TimeScopeEnum scope) 获取玩家指定范围的在线秒数。static longgetTime(UUID playerUuid, TimeScopeEnum scope, TimeUnit unit) 获取玩家指定范围、指定单位的在线时长。
-
方法详细资料
-
getSecond
获取玩家指定范围的在线秒数。- 参数:
playerUuid- 玩家 UIDscope- 统计范围- 返回:
- 在线秒数,玩家无记录时为 0
- 抛出:
IllegalArgumentException- 统计范围为空或不受支持时抛出
-
getTime
获取玩家指定范围、指定单位的在线时长。- 参数:
playerUuid- 玩家 UIDscope- 统计范围unit- 时间单位- 返回:
- 指定单位的在线时长,不足一个单位的部分向下取整
-