Various code householding

- Adjust javadoc
- Remove unused PlayerAuth constructor
- Replace legacy Settings with NewSetting calls
- Add process service to all (a)sync processes
- Change IP manager to only cache the calls to the VeryGames API
This commit is contained in:
ljacqu
2016-03-06 14:42:19 +01:00
parent 9a412fac05
commit 31bac6964f
25 changed files with 199 additions and 220 deletions
@@ -13,7 +13,6 @@ import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.util.StringUtils;
import fr.xephi.authme.util.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitTask;
@@ -54,7 +53,12 @@ public class AsynchronousQuit implements Process {
.realName(player.getName()).build();
database.updateQuitLoc(auth);
}
PlayerAuth auth = new PlayerAuth(name, ip, System.currentTimeMillis(), player.getName());
PlayerAuth auth = PlayerAuth.builder()
.name(name)
.realName(player.getName())
.ip(ip)
.lastLogin(System.currentTimeMillis())
.build();
database.updateSession(auth);
}
@@ -92,7 +96,7 @@ public class AsynchronousQuit implements Process {
service.getIpAddressManager().removeCache(player.getName());
if (plugin.isEnabled()) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
service.scheduleSyncDelayedTask(new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
}
// remove player from cache
if (database instanceof CacheDataSource) {