public boolean doPassword() {
        state = WAIT_PASSWORD;
        String input;
        String passwordChosen = "";
        String passwordEntered;
        boolean inputDone = false;
        boolean usePreservedPwd = false;
        boolean evaluatePwd;
        if (!dbInt.doesShipExist(shipName)) {
            sendText("\r\nOld Ship Password: ");
            usePreservedPwd = true;
        } else {
            sendText("\r\n Password: ");
        }
        // get the password
        do {
            //input = getCharacterInput(false, false, false);
            input = getBlockedInput(true, 60000, false);
            // If input is null, it's probably a socket error. Disconnect.
            if (input == null)
                return false;
            switch (input.charAt(0)) {
                case 3: // CTRL-C for disconnection.
                    return false;
                case 13: // Capture enter.
                    inputDone = true;
                    break;
                default: // Backspace and buffering.
                    if (isValidEraseCharacter(input.charAt(0))) {
                        if (passwordChosen.length() > 0) {
                            passwordChosen = passwordChosen.substring(0, passwordChosen.length() - 1);
                        }
                    } else {
                        passwordChosen += input;
                    }
                    break;
            }
        }
        while (!inputDone);
        passwordEntered = passwordChosen;
        if (usePreservedPwd) {
            evaluatePwd = dbInt.doesPreservedShipPasswordMatch(shipName, passwordEntered);
        } else {
            evaluatePwd = dbInt.doesShipPasswordMatch(shipName, passwordEntered);
        }
        // Are they the same, grasshopper?
        if (!evaluatePwd) {
            // GET THE HELL OUT OF HERE!! HaX0R!!
            TrekLog.logMessage("Invalid password attempt for " + shipName + "!");
            sendText("\r\nWrong password.\r\n");
            return false;
        }
        // if using a preserved ship, copy the player id into the new ship
        if (usePreservedPwd) {
            dbPlayerID = dbInt.getPreservedShipPlayer(shipName);
        } else { // using an existing ship
            dbPlayerID = dbInt.getPlayerID(shipName);
        }
        // Load the saved ship.
        dbInt.loadShipRecord(this);

        // display player specific login message
        String loginMessage = dbInt.getPlayerLoginMsg(dbPlayerID);
        if (loginMessage != null && !(loginMessage.equals(""))) {
            sendText("\r\n\r\n" + loginMessage.replaceAll("\n", "\r\n") + "\r\n");

            sendText("\r\nPress a key to proceed.");
            getBlockedInput(true, 60000, false);
        }

        state = WAIT_SUCCESSFULLOGIN;
        timeShipLogin = Calendar.getInstance().getTimeInMillis();
        return true;
    }