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:
@@ -4,6 +4,8 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.IpAddressManager;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.domain.Property;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -19,12 +21,15 @@ public class ProcessService {
|
||||
private final Messages messages;
|
||||
private final AuthMe authMe;
|
||||
private final IpAddressManager ipAddressManager;
|
||||
private final PasswordSecurity passwordSecurity;
|
||||
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe, IpAddressManager ipAddressManager) {
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe, IpAddressManager ipAddressManager,
|
||||
PasswordSecurity passwordSecurity) {
|
||||
this.settings = settings;
|
||||
this.messages = messages;
|
||||
this.authMe = authMe;
|
||||
this.ipAddressManager = ipAddressManager;
|
||||
this.passwordSecurity = passwordSecurity;
|
||||
}
|
||||
|
||||
public <T> T getProperty(Property<T> property) {
|
||||
@@ -75,4 +80,8 @@ public class ProcessService {
|
||||
return ipAddressManager;
|
||||
}
|
||||
|
||||
public HashedPassword computeHash(String password, String username) {
|
||||
return passwordSecurity.computeHash(password, username);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user