mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +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.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.mcRankAsync;
|
import com.gmail.nossr50.runnables.mcRankAsync;
|
||||||
import com.gmail.nossr50.util.Leaderboard;
|
import com.gmail.nossr50.util.Leaderboard;
|
||||||
import com.gmail.nossr50.util.Misc;
|
|
||||||
import com.gmail.nossr50.util.Skills;
|
import com.gmail.nossr50.util.Skills;
|
||||||
|
|
||||||
public class McrankCommand implements CommandExecutor {
|
public class McrankCommand implements CommandExecutor {
|
||||||
|
@ -16,11 +16,18 @@ public class Leaderboard {
|
|||||||
private static mcMMO plugin = mcMMO.p;
|
private static mcMMO plugin = mcMMO.p;
|
||||||
private final static String location = mcMMO.getUsersFile();
|
private final static String location = mcMMO.getUsersFile();
|
||||||
private static HashMap<SkillType, List<PlayerStat>> playerStatHash = new HashMap<SkillType, List<PlayerStat>>();
|
private static HashMap<SkillType, List<PlayerStat>> playerStatHash = new HashMap<SkillType, List<PlayerStat>>();
|
||||||
|
private static long lastUpdate = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the leader boards.
|
* Update the leader boards.
|
||||||
*/
|
*/
|
||||||
public static void updateLeaderboards() {
|
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
|
//Initialize lists
|
||||||
List<PlayerStat> mining, woodcutting, herbalism, excavation, acrobatics, repair, swords, axes, archery, unarmed, taming, fishing, powerlevel;
|
List<PlayerStat> mining, woodcutting, herbalism, excavation, acrobatics, repair, swords, axes, archery, unarmed, taming, fishing, powerlevel;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user