"autoLeaveAfterDaysOfInactivity" routine now runs only once every few minutes instead of running every time a player logs in. New setting "autoLeaveRoutineRunsEveryXMinutes" (default 5 minutes) to determine just how often the routine is run.
The routine is also slightly more careful about how it calculates how long a player has been offline.
This commit is contained in:
1 parent
d71bd15a79
commit
de3c7436fe
5 files changed
+60
-4
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.P;
|
||||
|
||||
public class AutoLeaveTask implements Runnable
|
||||
{
|
||||
double rate;
|
||||
|
||||
public AutoLeaveTask()
|
||||
{
|
||||
this.rate = Conf.autoLeaveRoutineRunsEveryXMinutes;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
FPlayers.i.autoLeaveOnInactivityRoutine();
|
||||
|
||||
// maybe setting has been changed? if so, restart task at new rate
|
||||
if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes)
|
||||
P.p.startAutoLeaveTask(true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user