If recovery code is required, dont send new password

This commit is contained in:
EbonJaguar
2017-03-22 17:11:18 -04:00
parent 46dd588923
commit 4053a0e328
33 changed files with 59 additions and 63 deletions
@@ -101,16 +101,25 @@ public class PasswordRecoveryService implements Reloadable {
if (couldSendMail) {
commonService.send(player, MessageKey.RECOVERY_EMAIL_SENT_MESSAGE);
emailCooldown.add(player.getName().toLowerCase());
String address = PlayerUtils.getPlayerIp(player);
successfulRecovers.put(name, address);
commonService.send(player, MessageKey.RECOVERY_CHANGE_PASSWORD);
} else {
commonService.send(player, MessageKey.EMAIL_SEND_FAILURE);
}
}
/**
* Allows a player to change their password after
* correctly entering a recovery code.
*
* @param player The player recovering their password.
*/
public void addSuccessfulRecovery(Player player) {
String name = player.getName();
String address = PlayerUtils.getPlayerIp(player);
successfulRecovers.put(name, address);
commonService.send(player, MessageKey.RECOVERY_CHANGE_PASSWORD);
}
/**
* Check if a player is able to have emails sent.
*