class PurgeLastPositionCommand implements ExecutableCommand {

    @Override
    public void executeCommand(final CommandSender sender, List<String> arguments) {
        String playerName = arguments.isEmpty() ? sender.getName() : arguments.get(0);

        if ("*".equals(playerName)) {
            for (PlayerAuth auth : dataSource.getAllAuths()) {
                resetLastPosition(auth);
                dataSource.updateQuitLoc(auth);
                bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_QUITLOC, playerName);
            }
            sender.sendMessage("All players last position locations are now reset");
        } else {
            // Get the user auth and make sure the user exists
            PlayerAuth auth = dataSource.getAuth(playerName);
            if (auth == null) {
                commonService.send(sender, MessageKey.UNKNOWN_USER);
                return;
            }

            resetLastPosition(auth);
            dataSource.updateQuitLoc(auth);
            bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_QUITLOC, playerName);
            sender.sendMessage(playerName + "'s last position location is now reset");
        }
    }

}