Add hidden options for uuid conversion

This commit is contained in:
TfT_02 2014-07-11 15:24:34 +02:00
parent 8d6f151a54
commit e7d5aa17bf
4 changed files with 20 additions and 2 deletions

View File

@ -12,6 +12,8 @@ public class HiddenConfig {
private static int conversionRate;
private static boolean useEnchantmentBuffs;
private static boolean resendChunksAfterBlockAbility;
private static int uuidConvertInterval;
private static int uuidConvertAmount;
public HiddenConfig(String fileName) {
HiddenConfig.fileName = fileName;
@ -33,6 +35,8 @@ public class HiddenConfig {
conversionRate = config.getInt("Options.ConversionRate", 1);
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
resendChunksAfterBlockAbility = config.getBoolean("Options.RefreshChunks", false);
uuidConvertInterval = config.getInt("Options.UUIDConvertInterval", 30);
uuidConvertAmount = config.getInt("Options.UUIDConvertAmount", 5);
}
}
@ -51,4 +55,12 @@ public class HiddenConfig {
public boolean resendChunksAfterBlockAbility() {
return resendChunksAfterBlockAbility;
}
public int getUUIDConvertInterval() {
return uuidConvertInterval;
}
public int getUUIDConvertAmount() {
return uuidConvertAmount;
}
}

View File

@ -460,7 +460,8 @@ public class mcMMO extends JavaPlugin {
new SaveTimerTask().runTaskTimer(this, saveIntervalTicks, saveIntervalTicks);
// Slowly update every entry in the database with UUIDs
new UUIDUpdateAsyncTask(this).runTaskTimerAsynchronously(this, 5 * Misc.TICK_CONVERSION_FACTOR, 30 * Misc.TICK_CONVERSION_FACTOR);
int uuidConvertInterval = HiddenConfig.getInstance().getUUIDConvertInterval();
new UUIDUpdateAsyncTask(this).runTaskTimerAsynchronously(this, uuidConvertInterval * Misc.TICK_CONVERSION_FACTOR, uuidConvertInterval * Misc.TICK_CONVERSION_FACTOR);
// Cleanup the backups folder
new CleanBackupsTask().runTaskAsynchronously(mcMMO.p);

View File

@ -12,7 +12,7 @@ import com.gmail.nossr50.util.Misc;
public class UUIDUpdateAsyncTask extends BukkitRunnable {
private mcMMO plugin;
private static final int MAX_LOOKUP = 5;
private static final int MAX_LOOKUP = HiddenConfig.getInstance().getUUIDConvertAmount();
private DatabaseManager databaseManager;
private List<String> userNames;

View File

@ -11,3 +11,8 @@ Options:
EnchantmentBuffs: true
# true to enable refreshing of chunks around a player at the end of Super Breaker, Giga Drill Breaker, and Berserk. This should fix blocks being broken client side, but not server-side
RefreshChunks: false
# The interval at which the server updates a couple of users to get their UUID, in seconds
UUIDConvertInterval: 30
# Amount of users to convert every interval
UUIDConvertAmount: 5