Remove need for thread locks in profile loading, just reschedule as needed. also stagger based on number of previous attempts.

This commit is contained in:
t00thpick1
2014-08-05 23:02:41 -04:00
parent da7507fc75
commit b7774251eb
6 changed files with 28 additions and 47 deletions

View File

@ -62,7 +62,7 @@ public class ConvertDatabaseCommand implements CommandExecutor {
mcMMO.getDatabaseManager().saveUser(profile);
}
new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 100); // 1 Tick delay to ensure the player is marked as online before we begin loading
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p);

View File

@ -38,7 +38,7 @@ public class ConvertExperienceCommand implements CommandExecutor {
new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
new PlayerProfileLoadingTask(player).runTaskTimerAsynchronously(mcMMO.p, 1, 100); // 1 Tick delay to ensure the player is marked as online before we begin loading
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
return true;