This commit is contained in:
Gabriele C
2017-11-02 11:24:17 +01:00
parent 6505538240
commit 273c318e96
22 changed files with 105 additions and 118 deletions
@@ -6,10 +6,11 @@ import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.service.BungeeService;
import fr.xephi.authme.service.bungeecord.BungeeService;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.service.bungeecord.MessageType;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -53,7 +54,7 @@ public class AsyncChangePassword implements AsynchronousProcess {
commonService.send(player, MessageKey.ERROR);
return;
}
bungeeService.sendRefreshPassword(name);
bungeeService.sendAuthMeBungeecordMessage(MessageType.REFRESH_PASSWORD, name);
playerCache.updatePlayer(auth);
commonService.send(player, MessageKey.PASSWORD_CHANGED_SUCCESS);
@@ -83,7 +84,7 @@ public class AsyncChangePassword implements AsynchronousProcess {
HashedPassword hashedPassword = passwordSecurity.computeHash(newPassword, lowerCaseName);
if (dataSource.updatePassword(lowerCaseName, hashedPassword)) {
bungeeService.sendRefreshPassword(lowerCaseName);
bungeeService.sendAuthMeBungeecordMessage(MessageType.REFRESH_PASSWORD, lowerCaseName);
if (sender != null) {
commonService.send(sender, MessageKey.PASSWORD_CHANGED_SUCCESS);
ConsoleLogger.info(sender.getName() + " changed password of " + lowerCaseName);