fix afk time
This commit is contained in:
@ -49,6 +49,7 @@ public final class popa extends JavaPlugin implements Listener {
|
||||
private String inventoryRequestsUrl;
|
||||
private String marketplaceUrl;
|
||||
private String bonusesUrl;
|
||||
private int afkTimeoutSeconds;
|
||||
private final Map<UUID, Long> playerLoginTimes = new HashMap<>();
|
||||
private final Map<UUID, String> playerNames = new HashMap<>();
|
||||
private ScheduledExecutorService scheduler;
|
||||
@ -61,6 +62,8 @@ public final class popa extends JavaPlugin implements Listener {
|
||||
saveDefaultConfig();
|
||||
reloadConfig();
|
||||
|
||||
afkTimeoutSeconds = getConfig().getInt("afk-timeout-seconds", 300);
|
||||
|
||||
// База для всех урлов
|
||||
apiBase = getConfig().getString("api-base", "http://localhost:8000");
|
||||
|
||||
@ -284,7 +287,7 @@ public final class popa extends JavaPlugin implements Listener {
|
||||
long inactiveSeconds = (currentTime - lastActivity) / 1000;
|
||||
|
||||
// Больше минуты не двигался — не отправляем в список активных
|
||||
if (inactiveSeconds > 60) {
|
||||
if (inactiveSeconds > afkTimeoutSeconds) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ api-base: "http://localhost:3001"
|
||||
# IP сервера (оставьте пустым для автоматического определения)
|
||||
server-ip: "minecraft.hub.popa-popa.ru"
|
||||
|
||||
afk-timeout-seconds: 300
|
||||
|
||||
# Интервалы обновления (в секундах)
|
||||
commands-interval-seconds: 5 # проверка команд
|
||||
inventory-interval-seconds: 5 # запросы инвентаря
|
||||
|
||||
Reference in New Issue
Block a user