Fixup, Add new command (#226)

* refactor saving

* add command to change password

* cleanup
This commit is contained in:
Danial authored and Daniel Ginovker committed 2019-12-01 13:40:54 -05:00
1 parent 930bc8d37b
commit bbb33d243e
6 files changed
+28 -20

No files matched your search

@@ -77,7 +77,22 @@ public class Commands implements PacketType {
case "coords":
case "coord":
case "pos":
player.getPacketSender().sendMessage("Your coords are [" + player.absX + "," + player.absY + "]");
player.getPacketSender().sendMessage("Your coords are [" + player.absX + ", " + player.absY + ", " + player.heightLevel + "]");
break;
case "password":
case "pwd":
if (arguments.length < 2) {
player.getPacketSender().sendMessage("Must have 2 arguments: ::password oldpassword newpassword");
return;
} else if (!PlayerSave.passwordHash(arguments[0]).equalsIgnoreCase(player.playerPass) || arguments[0].equalsIgnoreCase(player.playerPass)) {
player.getPacketSender().sendMessage("Your old password is incorrect");
return;
} else {
player.getPacketSender().sendMessage("Password updated!");
player.playerPass = arguments[1];
player.disconnected = true;
player.logout(true);
}
break;
case "null":
break;