mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-24 10:11:53 +01:00
Added config settings for ping delays #691
This commit is contained in:
parent
d587892df2
commit
268474d5ca
@ -52,6 +52,8 @@ public enum Settings {
|
||||
AFK_THRESHOLD_MINUTES("Data.AFKThresholdMinutes"),
|
||||
KEEP_LOGS_DAYS("Plugin.KeepLogsForXDays"),
|
||||
KEEP_INACTIVE_PLAYERS_DAYS("Data.KeepInactivePlayerDataForDays"),
|
||||
PING_SERVER_ENABLE_DELAY("Data.Ping.ServerEnableDelaySeconds"),
|
||||
PING_PLAYER_LOGIN_DELAY("Data.Ping.PlayerLoginDelaySeconds"),
|
||||
|
||||
// String
|
||||
DEBUG("Plugin.Debug"),
|
||||
|
@ -174,7 +174,9 @@ public class NetworkSettings {
|
||||
AFK_THRESHOLD_MINUTES,
|
||||
DATA_GEOLOCATIONS,
|
||||
KEEP_LOGS_DAYS,
|
||||
KEEP_INACTIVE_PLAYERS_DAYS
|
||||
KEEP_INACTIVE_PLAYERS_DAYS,
|
||||
PING_SERVER_ENABLE_DELAY,
|
||||
PING_PLAYER_LOGIN_DELAY
|
||||
};
|
||||
Log.debug("NetworkSettings: Adding Config Values..");
|
||||
for (Settings setting : sameStrings) {
|
||||
|
@ -5,10 +5,12 @@
|
||||
package com.djrapitops.plan.system.tasks;
|
||||
|
||||
import com.djrapitops.plan.Plan;
|
||||
import com.djrapitops.plan.system.settings.Settings;
|
||||
import com.djrapitops.plan.system.tasks.server.BukkitTPSCountTimer;
|
||||
import com.djrapitops.plan.system.tasks.server.PaperTPSCountTimer;
|
||||
import com.djrapitops.plan.system.tasks.server.PingCountTimer;
|
||||
import com.djrapitops.plugin.api.Check;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@ -33,8 +35,9 @@ public class BukkitTaskSystem extends ServerTaskSystem {
|
||||
try {
|
||||
PingCountTimer pingCountTimer = new PingCountTimer();
|
||||
((Plan) plugin).registerListener(pingCountTimer);
|
||||
long startDelay = TimeAmount.SECOND.ms() * (long) Settings.PING_SERVER_ENABLE_DELAY.getNumber();
|
||||
RunnableFactory.createNew("PingCountTimer", pingCountTimer)
|
||||
.runTaskTimer(20L, PingCountTimer.PING_INTERVAL);
|
||||
.runTaskTimer(startDelay, PingCountTimer.PING_INTERVAL);
|
||||
} catch (ExceptionInInitializerError | NoClassDefFoundError ignore) {
|
||||
// Running CraftBukkit
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ package com.djrapitops.plan.system.tasks.server;
|
||||
import com.djrapitops.plan.data.store.objects.DateObj;
|
||||
import com.djrapitops.plan.system.processing.Processing;
|
||||
import com.djrapitops.plan.system.processing.processors.player.PingInsertProcessor;
|
||||
import com.djrapitops.plan.system.settings.Settings;
|
||||
import com.djrapitops.plan.utilities.java.Reflection;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
@ -160,7 +161,7 @@ public class PingCountTimer extends AbsRunnable implements Listener {
|
||||
addPlayer(player);
|
||||
}
|
||||
}
|
||||
}).runTaskLater(TimeAmount.SECOND.ticks() * 15L);
|
||||
}).runTaskLater(TimeAmount.SECOND.ticks() * (long) Settings.PING_PLAYER_LOGIN_DELAY.getNumber());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -67,6 +67,9 @@ Data:
|
||||
LogUnknownCommands: false
|
||||
CombineCommandAliases: true
|
||||
Geolocations: true
|
||||
Ping:
|
||||
ServerEnableDelaySeconds: 300
|
||||
PlayerLoginDelaySeconds: 30
|
||||
KeepInactivePlayerDataForDays: 180
|
||||
# -----------------------------------------------------
|
||||
Customization:
|
||||
|
@ -81,6 +81,9 @@ Data:
|
||||
LogUnknownCommands: false
|
||||
CombineCommandAliases: true
|
||||
Geolocations: true
|
||||
Ping:
|
||||
ServerEnableDelaySeconds: 300
|
||||
PlayerLoginDelaySeconds: 30
|
||||
KeepInactivePlayerDataForDays: 180
|
||||
# -----------------------------------------------------
|
||||
Customization:
|
||||
|
Loading…
Reference in New Issue
Block a user