Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into 358-encryptn-mthd-refactor

This commit is contained in:
ljacqu
2015-12-28 13:33:18 +01:00
33 changed files with 112 additions and 160 deletions
@@ -15,21 +15,38 @@ public class PurgeLastPositionCommand implements ExecutableCommand {
String playerName = arguments.isEmpty() ? sender.getName() : arguments.get(0);
String playerNameLowerCase = playerName.toLowerCase();
// Get the user auth and make sure the user exists
PlayerAuth auth = commandService.getDataSource().getAuth(playerNameLowerCase);
if (auth == null) {
commandService.send(sender, MessageKey.UNKNOWN_USER);
return;
if (playerNameLowerCase.equalsIgnoreCase("*"))
{
for (PlayerAuth auth : commandService.getDataSource().getAllAuths())
{
// Set the last position
auth.setQuitLocX(0D);
auth.setQuitLocY(0D);
auth.setQuitLocZ(0D);
auth.setWorld("world");
commandService.getDataSource().updateQuitLoc(auth);
}
sender.sendMessage("All players last position locations are now reset");
}
else
{
// Get the user auth and make sure the user exists
PlayerAuth auth = commandService.getDataSource().getAuth(playerNameLowerCase);
if (auth == null) {
commandService.send(sender, MessageKey.UNKNOWN_USER);
return;
}
// Set the last position
auth.setQuitLocX(0D);
auth.setQuitLocY(0D);
auth.setQuitLocZ(0D);
auth.setWorld("world");
commandService.getDataSource().updateQuitLoc(auth);
// Show a status message
sender.sendMessage(playerNameLowerCase + "'s last position location is now reset");
}
// Set the last position
auth.setQuitLocX(0D);
auth.setQuitLocY(0D);
auth.setQuitLocZ(0D);
auth.setWorld("world");
commandService.getDataSource().updateQuitLoc(auth);
// Show a status message
sender.sendMessage(playerNameLowerCase + "'s last position location is now reset");
}
}