Revert "Cleanup"

This reverts commit 7fc195336f.
This commit is contained in:
Gabriele C 2016-07-27 09:51:01 +02:00
parent 6f46b7d1cb
commit b8d2d61ec5
4 changed files with 24 additions and 10 deletions

View File

@ -635,4 +635,19 @@ public class AuthMe extends JavaPlugin {
// Handle the command
return commandHandler.processCommand(sender, commandLabel, args);
}
// -------------
// Service getters (deprecated)
// Use @Inject fields instead
// -------------
/**
* @return process manager
*
* @deprecated should be used in API classes only (temporarily)
*/
@Deprecated
public Management getManagement() {
return management;
}
}

View File

@ -7,6 +7,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.BukkitService;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
@ -24,6 +25,9 @@ public class BungeeCordMessage implements PluginMessageListener {
@Inject
private PlayerCache playerCache;
@Inject
private Settings settings;
BungeeCordMessage() { }

View File

@ -13,7 +13,6 @@ import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.permission.AuthGroupType;
import fr.xephi.authme.permission.PlayerStatePermission;
import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.process.Management;
import fr.xephi.authme.process.ProcessService;
import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.PluginSettings;
@ -67,9 +66,6 @@ public class AsynchronousJoin implements AsynchronousProcess {
@Inject
private PlayerDataTaskManager playerDataTaskManager;
@Inject
private Management management;
AsynchronousJoin() {
}
@ -142,7 +138,7 @@ public class AsynchronousJoin implements AsynchronousProcess {
playerCache.removePlayer(name);
if (auth != null && auth.getIp().equals(ip)) {
service.send(player, MessageKey.SESSION_RECONNECTION);
management.performLogin(player, "dontneed", true);
plugin.getManagement().performLogin(player, "dontneed", true);
return;
} else if (service.getProperty(PluginSettings.SESSIONS_EXPIRE_ON_IP_CHANGE)) {
service.send(player, MessageKey.SESSION_EXPIRED);

View File

@ -8,7 +8,6 @@ import fr.xephi.authme.mail.SendMailSSL;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.permission.PermissionsManager;
import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.process.Management;
import fr.xephi.authme.process.ProcessService;
import fr.xephi.authme.process.SyncProcessManager;
import fr.xephi.authme.security.HashAlgorithm;
@ -33,6 +32,9 @@ import static fr.xephi.authme.permission.PlayerStatePermission.ALLOW_MULTIPLE_AC
public class AsyncRegister implements AsynchronousProcess {
@Inject
private AuthMe plugin;
@Inject
private DataSource database;
@ -57,9 +59,6 @@ public class AsyncRegister implements AsynchronousProcess {
@Inject
private SendMailSSL sendMailSsl;
@Inject
private Management management;
AsyncRegister() { }
private boolean preRegisterCheck(Player player, String password) {
@ -164,7 +163,7 @@ public class AsyncRegister implements AsynchronousProcess {
}
if (!service.getProperty(RegistrationSettings.FORCE_LOGIN_AFTER_REGISTER) && autoLogin) {
management.performLogin(player, "dontneed", true);
plugin.getManagement().performLogin(player, "dontneed", true);
}
syncProcessManager.processSyncPasswordRegister(player);