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