#1113 Handle LimboPlayers within LimboService (remove LimboCache) (work in progress)

- Delete LimboCache and LimboPlayerStorage: LimboService now handles all LimboPlayer actions
- Revoke player rights when creating a LimboPlayer, within the LimboService
- Various fixes and improvements
This commit is contained in:
ljacqu
2017-03-05 21:47:46 +01:00
parent 22ccf582b8
commit 021497b9e6
16 changed files with 138 additions and 850 deletions
@@ -111,12 +111,13 @@ public class AsynchronousUnregister implements AsynchronousProcess {
teleportationService.teleportOnJoin(player);
player.saveData();
// TODO #1113: Why delete? limboCache.deletePlayerData(player);
limboService.createLimboPlayer(player);
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> {
limboService.createLimboPlayer(player);
limboPlayerTaskManager.registerTimeoutTask(player);
limboPlayerTaskManager.registerMessageTask(name, false);
limboPlayerTaskManager.registerTimeoutTask(player);
limboPlayerTaskManager.registerMessageTask(name, false);
applyBlindEffect(player);
applyBlindEffect(player);
});
}
authGroupHandler.setGroup(player, AuthGroupType.UNREGISTERED);
service.send(player, MessageKey.UNREGISTERED_SUCCESS);
@@ -124,13 +125,8 @@ public class AsynchronousUnregister implements AsynchronousProcess {
private void applyBlindEffect(final Player player) {
if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
final int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
bukkitService.runTask(new Runnable() {
@Override
public void run() {
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2));
}
});
int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2));
}
}
}