bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarShare")) { LLNotificationsUtil::add("NoAvatarShare", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; } //Make sure we have some parameters if (params.size() == 0) { return false; } //Get the ID LLUUID id; if (!id.set( params[0], FALSE )) { return false; } //instigate share with this avatar LLAvatarActions::share( id ); return true; }
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap")) { LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; } //Make sure we have some parameters if (params.size() == 0) { return false; } //Get the ID LLUUID id; if (!id.set( params[0], FALSE )) { return false; } LLFloaterWorldMap::getInstance()->avatarTrackFromSlapp( id ); LLFloaterReg::showInstance( "world_map", "center" ); return true; }
BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name) { BOOL success = TRUE; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { return FALSE; } char tmp_str[64]; /*Flawfinder: ignore */ sscanf(valuestr,"%63s",tmp_str); /* Flawfinder: ignore */ value.set(tmp_str); return success; }
// static void FSLightshare::processWater(LightsharePacket* ls_packet) { LLWaterParamManager* wwparammgr = LLWaterParamManager::getInstance(); LLWaterParamSet & param_set = wwparammgr->mCurParams; param_set.set("waterFogColor", ls_packet->waterColor.red / 256.f, ls_packet->waterColor.green / 256.f, ls_packet->waterColor.blue / 256.f); param_set.set("waterFogDensity", pow(2.0f, ls_packet->waterFogDensityExponent)); param_set.set("underWaterFogMod", ls_packet->underwaterFogModifier); param_set.set("normScale", ls_packet->reflectionWaveletScale.X,ls_packet->reflectionWaveletScale.Y,ls_packet->reflectionWaveletScale.Z); param_set.set("fresnelScale", ls_packet->fresnelScale); param_set.set("fresnelOffset", ls_packet->fresnelOffset); param_set.set("scaleAbove", ls_packet->refractScaleAbove); param_set.set("scaleBelow", ls_packet->refractScaleBelow); param_set.set("blurMultiplier", ls_packet->blurMultiplier); param_set.set("wave1Dir", ls_packet->littleWaveDirection.X, ls_packet->littleWaveDirection.Y); param_set.set("wave2Dir", ls_packet->bigWaveDirection.X, ls_packet->bigWaveDirection.Y); LLUUID normalMapTexture; std::string out = llformat("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", (U8)(ls_packet->normalMapTexture[0]), (U8)(ls_packet->normalMapTexture[1]), (U8)(ls_packet->normalMapTexture[2]), (U8)(ls_packet->normalMapTexture[3]), (U8)(ls_packet->normalMapTexture[4]), (U8)(ls_packet->normalMapTexture[5]), (U8)(ls_packet->normalMapTexture[6]), (U8)(ls_packet->normalMapTexture[7]), (U8)(ls_packet->normalMapTexture[8]), (U8)(ls_packet->normalMapTexture[9]), (U8)(ls_packet->normalMapTexture[10]), (U8)(ls_packet->normalMapTexture[11]), (U8)(ls_packet->normalMapTexture[12]), (U8)(ls_packet->normalMapTexture[13]), (U8)(ls_packet->normalMapTexture[14]), (U8)(ls_packet->normalMapTexture[15])); normalMapTexture.set(out); wwparammgr->setNormalMapID(normalMapTexture); wwparammgr->setParamSet("LightshareCurrentRegion", param_set); wwparammgr->setNormalMapID(normalMapTexture); wwparammgr->propagateParameters(); }
//static LLUUID LLTextureEntry::getAgentIDFromMediaVersionString(const std::string &version_string) { LLUUID id; if (!version_string.empty()) { size_t found = version_string.find(MEDIA_VERSION_STRING_PREFIX); if (found != std::string::npos) { found = version_string.find_first_of("/", found); if (found != std::string::npos) { std::string v = version_string.substr(found + 1); id.set(v); } } } return id; }
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { //Make sure we have some parameters if (params.size() == 0) { return false; } //Get the ID LLUUID id; if (!id.set( params[0], FALSE )) { return false; } //instigate share with this avatar LLAvatarActions::share( id ); return true; }
// Checked: 2010-09-28 (RLVa-1.1.3a) | Added: RLVa-1.2.1c RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption) { EWearableType wtType(WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID); LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL; if (!(m_fEmpty = strOption.empty())) // <option> could be an empty string { if ((wtType = LLWearable::typeNameToType(strOption)) != WT_INVALID) m_varOption = wtType; // ... or specify a clothing layer else if ((pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption)) != NULL) m_varOption = pAttachPt; // ... or specify an attachment point else if ( ((UUID_STR_LENGTH - 1) == strOption.length()) && (idOption.set(strOption)) ) m_varOption = idOption; // ... or specify an UUID else if ((pFolder = RlvInventory::instance().getSharedFolder(strOption)) != NULL) m_varOption = pFolder; // ... or specify a shared folder path else if ((eAttachGroup = rlvAttachGroupFromString(strOption)) != RLV_ATTACHGROUP_INVALID) m_varOption = eAttachGroup; // ... or specify an attachment point group else m_varOption = strOption; // ... or it might just be a string } }
// Checked: 2011-05-26 (RLVa-1.3.1c) | Added: RLVa-1.3.1c void RlvFloaterBehaviours::onBtnCopyToClipboard() const { std::ostringstream strRestrictions; strRestrictions << RlvStrings::getVersion() << "\n"; const RlvHandler::rlv_object_map_t* pObjects = gRlvHandler.getObjectMap(); for (RlvHandler::rlv_object_map_t::const_iterator itObj = pObjects->begin(), endObj = pObjects->end(); itObj != endObj; ++itObj) { strRestrictions << "\n" << rlvGetItemNameFromObjID(itObj->first) << ":\n"; const rlv_command_list_t* pCommands = itObj->second.getCommandList(); for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd) { std::string strOption; LLUUID idOption; if ( (itCmd->hasOption()) && (idOption.set(itCmd->getOption(), FALSE)) && (idOption.notNull()) ) { LLAvatarName avName; if (gObjectList.findObject(idOption)) strOption = rlvGetItemNameFromObjID(idOption, true); else if (LLAvatarNameCache::get(idOption, &avName)) strOption = (!avName.getAccountName().empty()) ? avName.getAccountName() : avName.getDisplayName(); else if (!gCacheName->getGroupName(idOption, strOption)) strOption = itCmd->getOption(); } strRestrictions << " -> " << itCmd->asString(); if ( (!strOption.empty()) && (strOption != itCmd->getOption()) ) strRestrictions << " [" << strOption << "]"; if (RLV_RET_SUCCESS != itCmd->getReturnType()) strRestrictions << " (" << RlvStrings::getStringFromReturnCode(itCmd->getReturnType()) << ")"; strRestrictions << "\n"; } } LLWString wstrRestrictions = utf8str_to_wstring(strRestrictions.str()); gClipboard.copyFromSubstring(wstrRestrictions, 0, wstrRestrictions.length()); }
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { //Make sure we have some parameters if (params.size() == 0) { return false; } //Get the ID LLUUID id; if (!id.set(params[0], FALSE)) { return false; } if (gFloaterWorldMap) { std::string name; (void)gCacheName->getFullName(id, name); gFloaterWorldMap->trackAvatar(id, name); LLFloaterWorldMap::show(NULL, TRUE); } return true; }
// Checked: 2011-05-23 (RLVa-1.3.1c) | Modified: RLVa-1.3.1c void RlvFloaterBehaviours::refreshAll() { LLCtrlListInterface* pBhvrList = childGetListInterface("behaviour_list"); LLCtrlListInterface* pExceptList = childGetListInterface("exception_list"); if ( (!pBhvrList) || (!pExceptList) ) return; pBhvrList->operateOnAll(LLCtrlListInterface::OP_DELETE); pExceptList->operateOnAll(LLCtrlListInterface::OP_DELETE); if (!isAgentAvatarValid()) return; // // Set-up a row we can just reuse // LLSD sdBhvrRow; LLSD& sdBhvrColumns = sdBhvrRow["columns"]; sdBhvrColumns[0] = LLSD().with("column", "behaviour").with("type", "text"); sdBhvrColumns[1] = LLSD().with("column", "issuer").with("type", "text"); LLSD sdExceptRow; LLSD& sdExceptColumns = sdExceptRow["columns"]; sdExceptColumns[0] = LLSD().with("column", "behaviour").with("type", "text"); sdExceptColumns[1] = LLSD().with("column", "option").with("type", "text"); sdExceptColumns[2] = LLSD().with("column", "issuer").with("type", "text"); // // List behaviours // const RlvHandler::rlv_object_map_t* pObjects = gRlvHandler.getObjectMap(); for (RlvHandler::rlv_object_map_t::const_iterator itObj = pObjects->begin(), endObj = pObjects->end(); itObj != endObj; ++itObj) { const std::string strIssuer = rlvGetItemNameFromObjID(itObj->first); const rlv_command_list_t* pCommands = itObj->second.getCommandList(); for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd) { std::string strOption; LLUUID idOption; if ( (itCmd->hasOption()) && (idOption.set(itCmd->getOption(), FALSE)) && (idOption.notNull()) ) { LLAvatarName avName; if (gObjectList.findObject(idOption)) { strOption = rlvGetItemNameFromObjID(idOption, true); } else if (LLAvatarNameCache::get(idOption, &avName)) { strOption = (!avName.getAccountName().empty()) ? avName.getAccountName() : avName.getDisplayName(); } else if (!gCacheName->getGroupName(idOption, strOption)) { if (m_PendingLookup.end() == std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idOption)) { LLAvatarNameCache::get(idOption, boost::bind(&RlvFloaterBehaviours::onAvatarNameLookup, this, _1, _2)); m_PendingLookup.push_back(idOption); } strOption = itCmd->getOption(); } } if ( (itCmd->hasOption()) && (rlvGetShowException(itCmd->getBehaviourType())) ) { // List under the "Exception" tab sdExceptRow["enabled"] = gRlvHandler.isException(itCmd->getBehaviourType(), idOption); sdExceptColumns[0]["value"] = itCmd->getBehaviour(); sdExceptColumns[1]["value"] = strOption; sdExceptColumns[2]["value"] = strIssuer; pExceptList->addElement(sdExceptRow, ADD_BOTTOM); } else { // List under the "Restrictions" tab sdBhvrRow["enabled"] = (RLV_RET_SUCCESS == itCmd->getReturnType()); sdBhvrColumns[0]["value"] = (strOption.empty()) ? itCmd->asString() : itCmd->getBehaviour() + ":" + strOption; sdBhvrColumns[1]["value"] = strIssuer; pBhvrList->addElement(sdBhvrRow, ADD_BOTTOM); } } } }
//----------------------------------------------------------------------------- // Return the animation state for a given name //----------------------------------------------------------------------------- LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allow_ids ) { std::string lower_case_name(name); LLStringUtil::toLower(lower_case_name); char *true_name = mAnimStringTable.checkString(lower_case_name.c_str()); LLUUID id; id.setNull(); if (true_name) { for (anim_map_t::iterator iter = mAnimMap.begin(); iter != mAnimMap.end(); iter++) { if (iter->second == true_name) { id = iter->first; break; } } } else if (allow_ids) { // try to convert string to LLUUID id.set(name, FALSE); } return id; }