// Checked: 2010-03-03 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a void RlvBehaviourNotifyHandler::onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal) { if (fInternal) return; switch (rlvCmd.getParamType()) { case RLV_TYPE_ADD: case RLV_TYPE_REMOVE: sendNotification(rlvCmd.asString(), "=" + rlvCmd.getParam()); break; case RLV_TYPE_CLEAR: sendNotification(rlvCmd.asString()); break; default: break; } }
// Checked: 2009-12-23 (RLVa-1.1.0k) | Modified: RLVa-1.1.0k bool RlvExtGetSet::processCommand(const RlvCommand& rlvCmd, ERlvCmdRet& eRet) { std::string strBehaviour = rlvCmd.getBehaviour(), strGetSet, strSetting; int idxSetting = strBehaviour.find('_'); if ( (strBehaviour.length() >= 6) && (-1 != idxSetting) && ((int)strBehaviour.length() > idxSetting + 1) ) { strSetting = strBehaviour.substr(idxSetting + 1); strBehaviour.erase(idxSetting); // Get rid of "_<setting>" strGetSet = strBehaviour.substr(0, 3); strBehaviour.erase(0, 3); // Get rid of get/set if ("debug" == strBehaviour) { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { RlvUtil::sendChatReply(rlvCmd.getParam(), onGetDebug(strSetting)); eRet = RLV_RET_SUCCESS; return true; } else if ( ("set" == strGetSet) && (RLV_TYPE_FORCE == rlvCmd.getParamType()) ) { if (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETDEBUG, rlvCmd.getObjectID())) eRet = onSetDebug(strSetting, rlvCmd.getOption()); else eRet = RLV_RET_FAILED_LOCK; return true; } } else if ("env" == strBehaviour) { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { RlvUtil::sendChatReply(rlvCmd.getParam(), onGetEnv(strSetting)); eRet = RLV_RET_SUCCESS; return true; } else if ( ("set" == strGetSet) && (RLV_TYPE_FORCE == rlvCmd.getParamType()) ) { if (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETENV, rlvCmd.getObjectID())) eRet = onSetEnv(strSetting, rlvCmd.getOption()); else eRet = RLV_RET_FAILED_LOCK; return true; } } } else if ("setrot" == rlvCmd.getBehaviour()) { // NOTE: if <option> is invalid (or missing) altogether then RLV-1.17 will rotate to 0.0 (which is actually PI / 4) F32 nAngle = 0.0f; if (LLStringUtil::convertToF32(rlvCmd.getOption(), nAngle)) { nAngle = RLV_SETROT_OFFSET - nAngle; gAgent.startCameraAnimation(); LLVector3 at(LLVector3::x_axis); at.rotVec(nAngle, LLVector3::z_axis); at.normalize(); gAgent.resetAxes(at); eRet = RLV_RET_SUCCESS; } else { eRet = RLV_RET_FAILED_OPTION; } return true; } return false; }