Remove the IPManager
We don't need it anymore
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package fr.xephi.authme.process;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.IpAddressManager;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
@@ -25,20 +24,18 @@ public class ProcessService {
|
||||
private final Messages messages;
|
||||
private final AuthMe authMe;
|
||||
private final DataSource dataSource;
|
||||
private final IpAddressManager ipAddressManager;
|
||||
private final PasswordSecurity passwordSecurity;
|
||||
private final PluginHooks pluginHooks;
|
||||
private final SpawnLoader spawnLoader;
|
||||
private final ValidationService validationService;
|
||||
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe, DataSource dataSource,
|
||||
IpAddressManager ipAddressManager, PasswordSecurity passwordSecurity, PluginHooks pluginHooks,
|
||||
PasswordSecurity passwordSecurity, PluginHooks pluginHooks,
|
||||
SpawnLoader spawnLoader, ValidationService validationService) {
|
||||
this.settings = settings;
|
||||
this.messages = messages;
|
||||
this.authMe = authMe;
|
||||
this.dataSource = dataSource;
|
||||
this.ipAddressManager = ipAddressManager;
|
||||
this.passwordSecurity = passwordSecurity;
|
||||
this.pluginHooks = pluginHooks;
|
||||
this.spawnLoader = spawnLoader;
|
||||
@@ -155,15 +152,6 @@ public class ProcessService {
|
||||
return authMe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the IP address manager.
|
||||
*
|
||||
* @return the ip address manager
|
||||
*/
|
||||
public IpAddressManager getIpAddressManager() {
|
||||
return ipAddressManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the hash for the given password.
|
||||
*
|
||||
|
||||
@@ -69,7 +69,7 @@ public class AsynchronousJoin implements Process {
|
||||
service.getPluginHooks().setEssentialsSocialSpyStatus(player, false);
|
||||
}
|
||||
|
||||
final String ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
final String ip = Utils.getPlayerIp(player);
|
||||
if (isNameRestricted(name, ip, player.getAddress().getHostName(), service.getSettings())) {
|
||||
service.scheduleSyncDelayedTask(new Runnable() {
|
||||
@Override
|
||||
@@ -305,7 +305,7 @@ public class AsynchronousJoin implements Process {
|
||||
private boolean hasJoinedIp(String name, String ip, NewSetting settings) {
|
||||
int count = 0;
|
||||
for (Player player : Utils.getOnlinePlayers()) {
|
||||
if (ip.equalsIgnoreCase(service.getIpAddressManager().getPlayerIp(player))
|
||||
if (ip.equalsIgnoreCase(Utils.getPlayerIp(player))
|
||||
&& !player.getName().equalsIgnoreCase(name)) {
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class AsynchronousLogin implements Process {
|
||||
this.forceLogin = forceLogin;
|
||||
this.plugin = plugin;
|
||||
this.database = data;
|
||||
this.ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
this.ip = Utils.getPlayerIp(player);
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AsynchronousQuit implements Process {
|
||||
return;
|
||||
}
|
||||
|
||||
String ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
String ip = Utils.getPlayerIp(player);
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
@@ -94,7 +94,6 @@ public class AsynchronousQuit implements Process {
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
|
||||
service.getIpAddressManager().removeCache(player.getName());
|
||||
if (plugin.isEnabled()) {
|
||||
service.scheduleSyncDelayedTask(new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -44,7 +46,7 @@ public class AsyncRegister implements Process {
|
||||
this.email = email;
|
||||
this.plugin = plugin;
|
||||
this.database = data;
|
||||
this.ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
this.ip = Utils.getPlayerIp(player);
|
||||
this.playerCache = playerCache;
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ProcessSyncEmailRegister implements Process {
|
||||
|
||||
player.saveData();
|
||||
if (!service.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
|
||||
ConsoleLogger.info(player.getName() + " registered " + service.getIpAddressManager().getPlayerIp(player));
|
||||
ConsoleLogger.info(player.getName() + " registered " + Utils.getPlayerIp(player));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ProcessSyncPasswordRegister implements Process {
|
||||
player.saveData();
|
||||
|
||||
if (!Settings.noConsoleSpam) {
|
||||
ConsoleLogger.info(player.getName() + " registered " + service.getIpAddressManager().getPlayerIp(player));
|
||||
ConsoleLogger.info(player.getName() + " registered " + Utils.getPlayerIp(player));
|
||||
}
|
||||
|
||||
// Kick Player after Registration is enabled, kick the player
|
||||
|
||||
Reference in New Issue
Block a user