Minor - adjust PlayerAuth builder methods

- Rename hash() to password()
- Add location(Location) builder method
- Replace usages of password(new EncryptedPassword(hash, salt)) to the more terse password(String, String) builder method
This commit is contained in:
ljacqu
2015-12-30 18:28:06 +01:00
parent a3402d573f
commit 8b60c66cc8
10 changed files with 30 additions and 257 deletions
@@ -146,7 +146,7 @@ public class AsynchronousLogin {
.ip(getIP())
.lastLogin(new Date().getTime())
.email(email)
.hash(pAuth.getPassword())
.password(pAuth.getPassword())
.build();
database.updateSession(auth);
@@ -101,12 +101,9 @@ public class AsyncRegister {
PlayerAuth auth = PlayerAuth.builder()
.name(name)
.realName(player.getName())
.hash(encryptedPassword)
.password(encryptedPassword)
.ip(ip)
.locWorld(player.getLocation().getWorld().getName())
.locX(player.getLocation().getX())
.locY(player.getLocation().getY())
.locZ(player.getLocation().getZ())
.location(player.getLocation())
.email(email)
.build();
@@ -127,12 +124,9 @@ public class AsyncRegister {
PlayerAuth auth = PlayerAuth.builder()
.name(name)
.realName(player.getName())
.hash(encryptedPassword)
.password(encryptedPassword)
.ip(ip)
.locWorld(player.getLocation().getWorld().getName())
.locX(player.getLocation().getX())
.locY(player.getLocation().getY())
.locZ(player.getLocation().getZ())
.location(player.getLocation())
.build();
if (!database.saveAuth(auth)) {