diff --git a/src/org/apollo/io/player/impl/BinaryPlayerLoader.java b/src/org/apollo/io/player/impl/BinaryPlayerLoader.java index 4b3032dd..a96b53ad 100644 --- a/src/org/apollo/io/player/impl/BinaryPlayerLoader.java +++ b/src/org/apollo/io/player/impl/BinaryPlayerLoader.java @@ -52,6 +52,7 @@ public final class BinaryPlayerLoader implements PlayerLoader { if (!file.exists()) { Player player = new Player(credentials, SPAWN_POSITION); player.getBank().add(995, 25); // 25 coins + credentials.setPassword(SCryptUtil.scrypt(credentials.getPassword(), 16384, 8, 1)); return new PlayerLoaderResponse(LoginConstants.STATUS_OK, player); } diff --git a/src/org/apollo/io/player/impl/BinaryPlayerSaver.java b/src/org/apollo/io/player/impl/BinaryPlayerSaver.java index 94ebbefa..60cba4be 100644 --- a/src/org/apollo/io/player/impl/BinaryPlayerSaver.java +++ b/src/org/apollo/io/player/impl/BinaryPlayerSaver.java @@ -37,7 +37,7 @@ public final class BinaryPlayerSaver implements PlayerSaver { try (DataOutputStream out = new DataOutputStream(new FileOutputStream(file))) { // write credentials and privileges StreamUtil.writeString(out, player.getUsername()); - StreamUtil.writeString(out, player.getCredentials().getHashedPassword()); + StreamUtil.writeString(out, player.getCredentials().getPassword()); out.writeByte(player.getPrivilegeLevel().toInteger()); out.writeBoolean(player.isMembers()); diff --git a/src/org/apollo/security/PlayerCredentials.java b/src/org/apollo/security/PlayerCredentials.java index 495f1b38..e42a7039 100644 --- a/src/org/apollo/security/PlayerCredentials.java +++ b/src/org/apollo/security/PlayerCredentials.java @@ -2,8 +2,6 @@ package org.apollo.security; import org.apollo.util.NameUtil; -import com.lambdaworks.crypto.SCryptUtil; - /** * Holds the credentials for a player. * @@ -61,15 +59,6 @@ public final class PlayerCredentials { return encodedUsername; } - /** - * Gets the hashed password - * - * @return The password (either the original loaded from file or scrypted) - */ - public String getHashedPassword() { - return password.startsWith("$s0$") ? password : SCryptUtil.scrypt(password, 16384, 8, 1); - } - /** * Sets the player's password *