mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
FFS Leaderboards will only update every 10 minutes
This commit is contained in:
parent
fd4f0f4096
commit
67a4efa03e
@ -12,7 +12,6 @@ import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.mcRankAsync;
|
||||
import com.gmail.nossr50.util.Leaderboard;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Skills;
|
||||
|
||||
public class McrankCommand implements CommandExecutor {
|
||||
|
@ -16,11 +16,18 @@ public class Leaderboard {
|
||||
private static mcMMO plugin = mcMMO.p;
|
||||
private final static String location = mcMMO.getUsersFile();
|
||||
private static HashMap<SkillType, List<PlayerStat>> playerStatHash = new HashMap<SkillType, List<PlayerStat>>();
|
||||
private static long lastUpdate = 0;
|
||||
|
||||
/**
|
||||
* Update the leader boards.
|
||||
*/
|
||||
public static void updateLeaderboards() {
|
||||
if(System.currentTimeMillis() < lastUpdate + 600000) {
|
||||
return; //Only update FFS leaderboards every 10 minutes.. this puts a lot of strain on the server (depending on the size of the database) and should not be done frequently
|
||||
}
|
||||
|
||||
lastUpdate = System.currentTimeMillis(); //Log when the last update was run
|
||||
|
||||
//Initialize lists
|
||||
List<PlayerStat> mining, woodcutting, herbalism, excavation, acrobatics, repair, swords, axes, archery, unarmed, taming, fishing, powerlevel;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user