#432 #547 Remove public IP cache map; make processes use ProcessService

- Create IP address manager for handling and caching IP addresses -> outside of the manager I do not want to care about caching details
- Make more processes use the ProcessService in favor of statically injected objects
This commit is contained in:
ljacqu
2016-03-01 22:41:32 +01:00
parent 86042070e9
commit aeb8307a46
20 changed files with 330 additions and 296 deletions
@@ -6,6 +6,7 @@ import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.output.Messages;
import fr.xephi.authme.process.Process;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.Utils;
@@ -14,7 +15,7 @@ import org.bukkit.entity.Player;
/**
* Async task for changing the email.
*/
public class AsyncChangeEmail {
public class AsyncChangeEmail implements Process {
private final Player player;
private final String oldEmail;
@@ -35,7 +36,8 @@ public class AsyncChangeEmail {
this.settings = settings;
}
public void process() {
@Override
public void run() {
String playerName = player.getName().toLowerCase();
if (playerCache.isAuthenticated(playerName)) {
PlayerAuth auth = playerCache.getAuth(playerName);