public static Response processRegisterRequest(RegisterRequest request) {
        // answer Strings
        String userid;
        String command = REGISTER_COMMAND;
        String answer;

        Player player = null;
        RegisterResponse response = null;

        try {
            String nameFromRequest = request.getPlayerName();
            String passwordFromRequest = request.getPlayerPassword();
            player = new Player(nameFromRequest, passwordFromRequest);
        } catch (ValidationException vex) {
            userid = NO_ID;
            answer = ANSWER_BAD;
            String reason = vex.getMessage();
            response = new RegisterResponse(userid, command, answer, reason);
        }

        // If we still do not have Exception response created
        if (response == null) {
            OperationResult regPlayerResult = Croupie.newInstance().registerPlayer(player);

            if (regPlayerResult == OperationResult.PLAYER_REGISTERED) {
                userid = player.getId().toString();
                answer = ANSWER_OK;
                response = new RegisterResponse(userid, command, answer);
            } 
        }

        return response;
    }