Minor - make AuthMe.database private

- In favor of AuthMe.getDataSource()
This commit is contained in:
ljacqu
2015-12-29 11:55:57 +01:00
parent 571cb6d36b
commit 531327dd9b
17 changed files with 98 additions and 158 deletions
@@ -7,7 +7,6 @@ import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.security.crypts.HashResult;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
@@ -72,10 +71,8 @@ public class ChangePasswordAdminCommand implements ExecutableCommand {
HashResult hashResult = commandService.getPasswordSecurity().computeHash(playerPass, playerNameLowerCase);
auth.setHash(hashResult.getHash());
auth.setSalt(hashResult.getSalt());
if (PasswordSecurity.userSalt.containsKey(playerNameLowerCase)) {
auth.setSalt(PasswordSecurity.userSalt.get(playerNameLowerCase));
commandService.getDataSource().updateSalt(auth);
}
// TODO #358: updatePassword(auth) needs to update the salt, too.
if (!dataSource.updatePassword(auth)) {
commandService.send(sender, MessageKey.ERROR);
} else {
@@ -24,7 +24,7 @@ public class PurgeBannedPlayersCommand implements ExecutableCommand {
}
// Purge the banned players
plugin.database.purgeBanned(bannedPlayers);
plugin.getDataSource().purgeBanned(bannedPlayers);
if (Settings.purgeEssentialsFile && plugin.ess != null)
plugin.dataManager.purgeEssentials(bannedPlayers);
if (Settings.purgePlayerDat)