Пример #1
0
//static
LLMessageConfig::SenderTrust LLMessageConfig::getSenderTrustedness(
	const std::string& msg_name)
{
	LLMessageConfigFile& file = LLMessageConfigFile::instance();
	LLSD config = file.mMessages[msg_name];
	if (config.has("trusted-sender"))
	{
		return config["trusted-sender"].asBoolean() ? TRUSTED : UNTRUSTED;
	}
	return NOT_SET;
}
Пример #2
0
void LLMessageConfigFile::loadMaxQueuedEvents(const LLSD& data)
{
	 if (data.has("maxQueuedEvents"))
	 {
		  mMaxQueuedEvents = data["maxQueuedEvents"].asInteger();
	 }
	 else
	 {
		  mMaxQueuedEvents = DEFAULT_MAX_QUEUED_EVENTS;
	 }
}
Пример #3
0
	void insert(const LLSD& experience_data )
	{
		if(experience_data.has(EXPERIENCE_ID))
		{
            processExperience(experience_data[EXPERIENCE_ID].asUUID(), experience_data);
		}
		else
		{
			LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL;
		}
	}
//static
void LLFloaterBlacklist::addEntry(LLUUID key, LLSD data)
{
	if(key.notNull())
	{
		if(!data.has("entry_type"))
		{
			LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry type, specify LLAssetType::Etype" << LL_ENDL;
		}
		else if(!data.has("entry_name"))
		{
			LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry name, specify the name that should appear in the listing for this entry." << LL_ENDL;
		}
		else
		{
			if(!data.has("entry_date"))
			{
				LLDate* curdate = new LLDate(time_corrected());
				std::string input_date = curdate->asString();
				input_date.replace(input_date.find("T"),1," ");
				input_date.resize(input_date.size() - 1);
				data["entry_date"] = input_date;
			}
			if(data["entry_type"].asString() == "1")
			{
				//remove sounds
				LLUUID sound_id=LLUUID(key);
				gVFS->removeFile(sound_id,LLAssetType::AT_SOUND);
				std::string wav_path= gDirUtilp->getExpandedFilename(LL_PATH_CACHE,sound_id.asString()) + ".dsf";
				if(LLAPRFile::isExist(wav_path, LL_APR_RPB))
					LLAPRFile::remove(wav_path);
				gAudiop->removeAudioData(sound_id);
			}
			blacklist_entries.insert(std::pair<LLUUID,LLSD>(key,data));
			updateBlacklists();
		}
	}
	else
	{
		LL_WARNS("FloaterBlacklistAdd") << "addEntry called with a null entry key, please specify LLUUID of asset." << LL_ENDL;
	}
}
bool LLGridManager::addGrid(LLSD& grid_data)
{
	if (grid_data.isMap() && grid_data.has(GRID_VALUE))
	{
		std::string grid = utf8str_tolower(grid_data[GRID_VALUE]);

		// grid should be in the form of a dns address
		if (!grid.empty() &&
			grid.find_first_not_of("abcdefghijklmnopqrstuvwxyz1234567890-_. ") != std::string::npos)
		{
			llinfos << "Invalid grid name " << grid << llendl;
			return false;
		}
		
		// populate the other values if they don't exist
		if (!grid_data.has(GRID_LABEL_VALUE)) 
		{
			grid_data[GRID_LABEL_VALUE] = grid;
		}
		if (!grid_data.has(GRID_ID_VALUE))
		{
			grid_data[GRID_ID_VALUE] = grid;
		}
		
		// if the grid data doesn't include any of the URIs, then 
		// generate them from the grid, which should be a dns address
		if (!grid_data.has(GRID_LOGIN_URI_VALUE)) 
		{
			grid_data[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
			grid_data[GRID_LOGIN_URI_VALUE].append(std::string("https://") + 
													grid + "/cgi-bin/login.cgi");
		}
		// Populate to the default values
		if (!grid_data.has(GRID_LOGIN_PAGE_VALUE)) 
		{
			grid_data[GRID_LOGIN_PAGE_VALUE] = std::string("http://") + grid + "/app/login/";
		}		
		if (!grid_data.has(GRID_HELPER_URI_VALUE)) 
		{
			grid_data[GRID_HELPER_URI_VALUE] = std::string("https://") + grid + "/helpers/";
		}
		
		if (!grid_data.has(GRID_LOGIN_IDENTIFIER_TYPES))
		{
			// non system grids and grids that haven't already been configured with values
			// get both types of credentials.
			grid_data[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray();
			grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
			grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_ACCOUNT);
		}
		
		LL_DEBUGS("GridManager") << "ADDING: " << grid << LL_ENDL;
		mGridList[grid] = grid_data;		
	}
	return true;
}
//virtual
S32 LLAvatarList::notifyParent(const LLSD& info)
{
	if (info.has("sort") && &NAME_COMPARATOR == mItemComparator)
	{
		sort();
		return 1;
	}
// [SL:KB] - Patch: UI-AvatarListDndShare | Checked: 2011-06-19 (Catznip-2.6.0c) | Added: Catznip-2.6.0c
	else if ( (info.has("select")) && (info["select"].isUUID()) )
	{
		const LLSD& sdValue = getSelectedValue();
		const LLUUID idItem = info["select"].asUUID();
		if ( (!sdValue.isDefined()) || ((sdValue.isUUID()) && (sdValue.asUUID() != idItem)) )
		{
			resetSelection();
			selectItemByUUID(info["select"].asUUID());
		}
	}
// [/SL:KB]
	return LLFlatListViewEx::notifyParent(info);
}
lggBeamsColors lggBeamsColors::fromLLSD(const LLSD& inputData)
{
	lggBeamsColors toReturn;
	
	if (inputData.has("startHue"))
	{
		toReturn.mStartHue = (F32)inputData["startHue"].asReal();
	}

	if (inputData.has("endHue"))
	{
		toReturn.mEndHue = (F32)inputData["endHue"].asReal();
	}

	if (inputData.has("rotateSpeed"))
	{
		toReturn.mRotateSpeed = (F32)inputData["rotateSpeed"].asReal();
	}

	return toReturn;
}
Пример #8
0
S32 LLTeleportHistoryFlatItem::notify(const LLSD& info)
{
	if(info.has("detach"))
	{
		delete mMouseDownSignal;
		mMouseDownSignal = NULL;
		delete mRightMouseDownSignal;
		mRightMouseDownSignal = NULL;
		return 1;
	}
	return 0;
}
bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification, const LLSD& response)
{
	LL_DEBUGS("AutoReplace")<<"called"<<LL_ENDL;
	
	LLSD newList = notification["payload"]["list"];

	if ( response.has("listname") && response["listname"].isString() )
	{
		std::string newName = response["listname"].asString();
		LLAutoReplaceSettings::setListName(newList, newName);

		switch ( mSettings.addList(newList) )
		{
		case LLAutoReplaceSettings::AddListOk:
			LL_INFOS("AutoReplace") << "added new list '"<<newName<<"'"<<LL_ENDL;
			mSelectedListName = newName;
			updateListNames();
			updateListNamesControls();
			updateReplacementsList();
			break;

		case LLAutoReplaceSettings::AddListDuplicateName:
			{
				LL_WARNS("AutoReplace")<<"name '"<<newName<<"' is in use; prompting for new name"<<LL_ENDL;
				LLSD newPayload;
				newPayload["list"] = notification["payload"]["list"];
				LLSD args;
				args["DUPNAME"] = newName;
	
				LLNotificationsUtil::add("RenameAutoReplaceList", args, newPayload,
										 boost::bind(&LLFloaterAutoReplaceSettings::callbackListNameConflict, this, _1, _2));
			}
			break;

		case LLAutoReplaceSettings::AddListInvalidList:
			LLNotificationsUtil::add("InvalidAutoReplaceList");

			mSelectedListName.clear();
			updateListNames();
			updateListNamesControls();
			updateReplacementsList();
			break;

		default:
			LL_ERRS("AutoReplace") << "invalid AddListResult" << LL_ENDL;
		}
	}
	else
	{
		LL_ERRS("AutoReplace") << "adding notification response" << LL_ENDL;
	}
	return false;
}
void LLFloaterSearch::onOpen(const LLSD& key)
{
	Params p(key);
	p.trusted_content = true;
	p.allow_address_entry = false;

	LLFloaterWebContent::onOpen(p);
	if ( (key.has("category")) || ((mWebBrowser) && (mWebBrowser->getCurrentNavUrl().empty())) )
	{
		search(p.search);
	}
}
void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids)
{
	if (content.has(name))
	{
		for(LLSD::array_const_iterator it = content[name].beginArray(),
				end = content[name].endArray();
				it != end; ++it)
		{
			ids.insert((*it).asUUID());
		}
	}
}
void LLCommandDispatcherListener::dispatch(const LLSD& params) const
{
    // For most purposes, we expect callers to want to be trusted.
    bool trusted_browser = true;
    if (params.has("trusted"))
    {
        // But for testing, allow a caller to specify untrusted.
        trusted_browser = params["trusted"].asBoolean();
    }
    LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], NULL,
                                  "clicked", trusted_browser);
}
void LLAgentListener::resetAxes(const LLSD& event) const
{
    if (event.has("lookat"))
    {
        mAgent.resetAxes(ll_vector3_from_sd(event["lookat"]));
    }
    else
    {
        // no "lookat", default call
        mAgent.resetAxes();
    }
}
Пример #14
0
// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object
bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map, LLMediaCtrl* web)
{
	LLUUID task_id = tokens[0].asUUID();
	std::string name = query_map["name"].asString();
	std::string slurl = query_map["slurl"].asString();
	LLUUID owner = query_map["owner"].asUUID();
	bool group_owned = query_map.has("groupowned");
	
	LLObjectIMInfo::show(task_id,name,slurl,owner,group_owned);

	return true;
}
Пример #15
0
//#include "llvoavatar.h"
//LLVOAvatarSelf *gAgentAvatarp = NULL;
lggIrcData lggIrcData::fromLLSD(LLSD inputData)
{
	
	lggIrcData toReturn;
	if(inputData.has("ircserver")) toReturn.server = inputData["ircserver"].asString();
	if(inputData.has("ircname")) toReturn.name = inputData["ircname"].asString();
	if(inputData.has("ircport")) toReturn.port = inputData["ircport"].asString();
	if(inputData.has("ircnick")) toReturn.nick = inputData["ircnick"].asString();
	if(inputData.has("ircchannel")) toReturn.channel = inputData["ircchannel"].asString();
	if(inputData.has("ircnickpassword")) toReturn.nickPassword = inputData["ircnickpassword"].asString();
	if(inputData.has("ircchannelpassword")) toReturn.channelPassword = inputData["ircchannelpassword"].asString();
	if(inputData.has("ircserverpassword")) toReturn.serverPassword = inputData["ircserverpassword"].asString();
	if(inputData.has("ircautologin")) toReturn.autoLogin = inputData["ircautologin"].asBoolean();
	if(inputData.has("ircid")) toReturn.id = LLUUID(inputData["ircid"].asString());
	//support for legacy format
	if(inputData.has("ircpassword")) toReturn.nickPassword = inputData["ircpassword"].asString();

	return toReturn;


}
void LFSimFeatureHandler::setSupportedFeatures()
{
	if (LLViewerRegion* region = gAgent.getRegion())
	{
		LLSD info;
		region->getSimulatorFeatures(info);
		//if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Non-SL specific sim features
		{
			mSupportsExport = info.has("ExportSupported");
		}
	}
}
Пример #17
0
void LLAgentListener::startAutoPilot(LLSD const & event_data)
{
    LLQuaternion target_rotation_value;
    LLQuaternion* target_rotation = NULL;
    if (event_data.has("target_rotation"))
    {
        target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]);
        target_rotation = &target_rotation_value;
    }
    // *TODO: Use callback_pump and callback_data
    F32 rotation_threshold = 0.03f;
    if (event_data.has("rotation_threshold"))
    {
        rotation_threshold = event_data["rotation_threshold"].asReal();
    }
	
	BOOL allow_flying = TRUE;
	if (event_data.has("allow_flying"))
	{
		allow_flying = (BOOL) event_data["allow_flying"].asBoolean();
		mAgent.setFlying(allow_flying);
	}

	F32 stop_distance = 0.f;
	if (event_data.has("stop_distance"))
	{
		stop_distance = event_data["stop_distance"].asReal();
	}

	// Clear follow target, this is doing a path
	mFollowTarget.setNull();

    mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event_data["target_global"]),
                                event_data["behavior_name"],
                                target_rotation,
                                NULL, NULL,
                                stop_distance,
                                rotation_threshold,
								allow_flying);
}
Пример #18
0
LLSavedLoginEntry::LLSavedLoginEntry(const LLSD& entry_data)
{
	if (entry_data.isUndefined() || !entry_data.isMap())
	{
		throw std::invalid_argument("Cannot create a null login entry.");
	}
	if (!entry_data.has("firstname"))
	{
		throw std::invalid_argument("Missing firstname key.");
	}
	if (!entry_data.has("lastname"))
	{
		throw std::invalid_argument("Missing lastname key.");
	}
	if (!entry_data.has("grid"))
	{
		throw std::invalid_argument("Missing grid key.");
	}
	if (!entry_data.has("password"))
	{
		throw std::invalid_argument("Missing password key.");
	}
	if (!entry_data.get("grid").isInteger())
	{
		throw std::invalid_argument("grid key is not integer.");
	}
	if (!entry_data.get("firstname").isString())
	{
		throw std::invalid_argument("firstname key is not string.");
	}
	if (!entry_data.get("lastname").isString())
	{
		throw std::invalid_argument("lastname key is not string.");
	}
	if (!(entry_data.get("password").isUndefined() || entry_data.get("password").isBinary()))
	{
		throw std::invalid_argument("password key is neither blank nor binary.");
	}
	mEntry = entry_data;
}
Пример #19
0
void LLPanelProfile::onOpen(const LLSD& key)
{
	// open the desired panel
	if (key.has("open_tab_name"))
	{
		getTabContainer()[PANEL_PICKS]->onClosePanel();

		// onOpen from selected panel will be called from onTabSelected callback
		getTabCtrl()->selectTabByName(key["open_tab_name"]);
	}
	else
	{
		getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId());
	}

	// support commands to open further pieces of UI
	if (key.has("show_tab_panel"))
	{
		std::string panel = key["show_tab_panel"].asString();
		if (panel == "create_classified")
		{
			LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]);
			if (picks)
			{
				picks->createNewClassified();
			}
		}
		else if (panel == "classified_details")
		{
			LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]);
			if (picks)
			{
				LLSD params = key;
				params.erase("show_tab_panel");
				params.erase("open_tab_name");
				picks->openClassifiedInfo(params);
			}
		}
	}
}
Пример #20
0
void LLSidepanelInventory::onOpen(const LLSD& key)
{
	LLFirstUse::newInventory(false);

#if AUTO_EXPAND_INBOX
	// Expand the inbox if we have fresh items
	LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
	if (inbox && (inbox->getFreshItemCount() > 0))
	{
		getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true);
		onToggleInboxBtn();
	}
#else
	if (mInboxEnabled && getChild<LLButton>(INBOX_BUTTON_NAME)->getToggleState())
	{
		gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
	}
#endif

	if(key.size() == 0)
		return;

	mItemPanel->reset();

	if (key.has("id"))
	{
		mItemPanel->setItemID(key["id"].asUUID());
		if (key.has("object"))
		{
			mItemPanel->setObjectID(key["object"].asUUID());
		}
		showItemInfoPanel();
	}
	if (key.has("task"))
	{
		if (mTaskPanel)
			mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
		showTaskInfoPanel();
	}
}
Пример #21
0
	virtual void post(ResponsePtr response,
					  const LLSD& context,
					  const LLSD& input) const
	{
		LLSD body;
		LLUUID temp_session_id;
		LLUUID session_id;
		bool success;

		body = input["body"];
		success = body["success"].asBoolean();
		temp_session_id = body["temp_session_id"].asUUID();

		if ( success )
		{
			session_id = body["session_id"].asUUID();
			gIMMgr->updateFloaterSessionID(
				temp_session_id,
				session_id);
			LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id);
			if (floaterp)
			{
				floaterp->setSpeakers(body);

				//apply updates we've possibly received previously
				floaterp->updateSpeakersList(
					gIMMgr->getPendingAgentListUpdates(session_id));

				if ( body.has("session_info") )
				{
					floaterp->processSessionUpdate(body["session_info"]);
				}

				//aply updates we've possibly received previously
				floaterp->updateSpeakersList(
					gIMMgr->getPendingAgentListUpdates(session_id));
			}
			gIMMgr->clearPendingAgentListUpdates(session_id);
		}
		else
		{
			//throw an error dialog and close the temp session's floater
			LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(temp_session_id);

			if ( floater )
			{
				floater->showSessionStartError(body["error"].asString());
			}
		}

		gIMMgr->clearPendingAgentListUpdates(session_id);
	}
// Update controls based on current settings
void LLPrefsAscentVan::refresh()
{
    //Tags\Colors ----------------------------------------------------------------------------
    //Colors ---------------------------------------------------------------------------------
	LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
	if(LLVOAvatar::sClientResolutionList.has("isComplete"))
	{
		//combo->setColor(LLColor4::black);
		combo->clear();
		for(LLSD::map_iterator itr = LLVOAvatar::sClientResolutionList.beginMap(); itr != LLVOAvatar::sClientResolutionList.endMap(); itr++)
		{
			LLSD value = (*itr).second;
			if(value.has("name"))
			{
				std::string name = value.get("name");
				std::string uuid = (*itr).first;
				LLColor4 color = LLColor4(value.get("color"));
				if(value["multiple"].asReal() != 0)
				{
					color *= 1.0/(value["multiple"].asReal()+1.0f);
				}
				LLScrollListItem* item = combo->add(name,uuid);
				//bad practice
				item->getColumn(0)->setColor(color);
			}
		}
		//add Viewer 2.0
		LLScrollListItem* item = combo->add("Viewer 2.0",IMG_DEFAULT_AVATAR);
		//bad practice
		item->getColumn(0)->setColor(LLColor4::black);
	}
	combo->setCurrentByIndex(mSelectedClient);

    childSetEnabled("friends_color_textbox",     mUseStatusColors);
    childSetEnabled("friend_color_swatch",       mUseStatusColors);
    childSetEnabled("estate_owner_color_swatch", mUseStatusColors);
    childSetEnabled("linden_color_swatch",       mUseStatusColors);
    childSetEnabled("muted_color_swatch",        mUseStatusColors);

    childSetEnabled("custom_tag_label_text",   mCustomTagOn);
    childSetEnabled("custom_tag_label_box",    mCustomTagOn);
    childSetValue("custom_tag_label_box", gSavedSettings.getString("AscentCustomTagLabel"));
    childSetEnabled("custom_tag_color_text",   mCustomTagOn);
    childSetEnabled("custom_tag_color_swatch", mCustomTagOn);

    //Body Dynamics --------------------------------------------------------------------------
    childSetEnabled("EmeraldBoobMass",     mBreastPhysicsToggle);
    childSetEnabled("EmeraldBoobHardness", mBreastPhysicsToggle);
    childSetEnabled("EmeraldBoobVelMax",   mBreastPhysicsToggle);
    childSetEnabled("EmeraldBoobFriction", mBreastPhysicsToggle);
    childSetEnabled("EmeraldBoobVelMin",   mBreastPhysicsToggle);
}
Пример #23
0
// Checked: 2011-11-08 (RLVa-1.5.0)
void RlvStrings::loadFromFile(const std::string& strFilePath, bool fUserOverride)
{
	llifstream fileStream(strFilePath, std::ios::binary); LLSD sdFileData;
	if ( (!fileStream.is_open()) || (!LLSDSerialize::fromXMLDocument(sdFileData, fileStream)) )
		return;
	fileStream.close();

	if (sdFileData.has("strings"))
	{
		const LLSD& sdStrings = sdFileData["strings"];
		for (LLSD::map_const_iterator itString = sdStrings.beginMap(); itString != sdStrings.endMap(); ++itString)
		{
			if ( (!itString->second.has("value")) || ((fUserOverride) && (!hasString(itString->first))) )
				continue;

			std::list<std::string>& listValues = m_StringMap[itString->first];
			if (!fUserOverride)
			{
				if (listValues.size() > 0)
					listValues.pop_front();
				listValues.push_front(itString->second["value"].asString());
			}
			else
			{
				while (listValues.size() > 1)
					listValues.pop_back();
				listValues.push_back(itString->second["value"].asString());
			}
		}
	}
	if (sdFileData.has("anonyms"))
	{
		const LLSD& sdAnonyms = sdFileData["anonyms"];
		for (LLSD::array_const_iterator itAnonym = sdAnonyms.beginArray(); itAnonym != sdAnonyms.endArray(); ++itAnonym)
		{
			m_Anonyms.push_back((*itAnonym).asString());
		}
	}
}
void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap())
{
#if LL_DARWIN
	//mLLCEFLib->keyPress(utf8str[0], true);
	//mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0);
    if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") ||
            !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers"))
        return;
    uint32_t unicodeChar = native_key_data["event_chars"].asInteger();
    uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger();
    uint32_t keyCode = native_key_data["event_keycode"].asInteger();
    uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger();
    
    mLLCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers);
    
#elif LL_WINDOWS
	U32 msg = ll_U32_from_sd(native_key_data["msg"]);
	U32 wparam = ll_U32_from_sd(native_key_data["w_param"]);
	U64 lparam = ll_U32_from_sd(native_key_data["l_param"]);
	mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam);
#endif
};
Пример #25
0
bool LLInventoryCategory::fromLLSD(LLSD& sd)
{
    std::string w;

    w = INV_FOLDER_ID_LABEL_WS;
    if (sd.has(w))
    {
        mUUID = sd[w];
    }
    w = INV_PARENT_ID_LABEL;
    if (sd.has(w))
    {
        mParentUUID = sd[w];
    }
    w = INV_ASSET_TYPE_LABEL;
    if (sd.has(w))
    {
        S8 type = (U8)sd[w].asInteger();
        mPreferredType = static_cast<LLAssetType::EType>(type);
    }
	w = INV_ASSET_TYPE_LABEL_WS;
	if (sd.has(w))
	{
		S8 type = (U8)sd[w].asInteger();
        mPreferredType = static_cast<LLAssetType::EType>(type);
	}

    w = INV_NAME_LABEL;
    if (sd.has(w))
    {
        mName = sd[w].asString();
        LLStringUtil::replaceNonstandardASCII(mName, ' ');
        LLStringUtil::replaceChar(mName, '|', ' ');
    }

	// note: no version check here! Not usable for cache!

    return true;
}
Пример #26
0
	/*virtual*/ void post(
		LLHTTPNode::ResponsePtr response,
		const LLSD& context,
		const LLSD& input) const
	{
		if (!input || !context || !input.isMap() || !input.has("body")) {
			LL_INFOS() << "malformed WindLightRefresh!" << LL_ENDL;	 
			return;
		}

		//std::string dump = input["body"].asString();
		//LL_WARNS() << dump << LL_ENDL;

		LLSD body = input["body"];
		LLEnvManagerNew *env = &LLEnvManagerNew::instance();

		LLViewerRegion* regionp = gAgent.getRegion();
		LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;

		env->mNewRegionPrefs.clear();
		env->mCurRegionUUID = region_uuid;

		if(body.has("Interpolate")) {
			if(body["Interpolate"].asInteger() == 1) {
				env->mInterpNextChangeMessage = true;
			}
			else {
				env->mInterpNextChangeMessage = false;
			}
		}
		else {
			env->mInterpNextChangeMessage = true;
		}
		LL_INFOS() << "Windlight Refresh , interpolate:" << env->mInterpNextChangeMessage << LL_ENDL;
		env->requestRegionSettings();

		// Ansa: This cause the windlight editor and others to update since the windlight has changed!
		gAgent.changeRegion();
	}
Пример #27
0
bool LLSDRPCResponse::extractResponse(const LLSD& sd)
{
	LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
	bool rv = true;
	if(sd.has(LLSDRPC_RESPONSE_NAME))
	{
		mReturnValue = sd[LLSDRPC_RESPONSE_NAME];
		mIsFault = false;
	}
	else if(sd.has(LLSDRPC_FAULT_NAME))
	{
		mReturnValue = sd[LLSDRPC_FAULT_NAME];
		mIsFault = true;
	}
	else
	{
		mReturnValue.clear();
		mIsError = true;
		rv = false;
	}
	return rv;
}
	void viewerNetworkTestObject::test<1>()
	{

		LLGridManager *manager = LLGridManager::getInstance();
		// grid file doesn't exist
		manager->initialize("grid_test.xml");
		// validate that some of the defaults are available.
		std::map<std::string, std::string> known_grids = manager->getKnownGrids();
		ensure_equals("Known grids is a string-string map of size 23", known_grids.size(), 23);
		ensure_equals("Agni has the right name and label", 
					  known_grids[std::string("util.agni.lindenlab.com")], std::string("Agni"));
		ensure_equals("None exists", known_grids[""], "None");
		
		LLSD grid;
		LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com", grid);
		ensure("Grid info for agni is a map", grid.isMap());
		ensure_equals("name is correct for agni", 
					  grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com"));
		ensure_equals("label is correct for agni", 
					  grid[GRID_LABEL_VALUE].asString(), std::string("Agni"));
		ensure("Login URI is an array", 
			   grid[GRID_LOGIN_URI_VALUE].isArray());
		ensure_equals("Agni login uri is correct", 
					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
					  std::string("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
		ensure_equals("Agni helper uri is correct",
					  grid[GRID_HELPER_URI_VALUE].asString(), 
					  std::string("https://secondlife.com/helpers/"));
		ensure_equals("Agni login page is correct",
					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
					  std::string("http://viewer-login.agni.lindenlab.com/"));
		ensure("Agni is a favorite",
			   grid.has(GRID_IS_FAVORITE_VALUE));
		ensure("Agni is a system grid", 
			   grid.has(GRID_IS_SYSTEM_GRID_VALUE));
		ensure("Grid file wasn't greated as it wasn't saved", 
			   !LLFile::isfile("grid_test.xml"));
	}
void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
{
	if (!success)
	{
		// *TODO: is there any kind of error handling we can do here?
		LL_WARNS("Materials")<< "failed"<<LL_ENDL;
		return;
	}

	llassert(content.isMap());
	llassert(content.has(MATERIALS_CAP_ZIP_FIELD));
	llassert(content[MATERIALS_CAP_ZIP_FIELD].isBinary());

	LLSD::Binary content_binary = content[MATERIALS_CAP_ZIP_FIELD].asBinary();
	std::string content_string(reinterpret_cast<const char*>(content_binary.data()), content_binary.size());
	std::istringstream content_stream(content_string);

	LLSD response_data;
	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
	{
		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
		return;
	}
	else
	{
		llassert(response_data.isArray());
		LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
		for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter)
		{
#           ifndef LL_RELEASE_FOR_DOWNLOAD
			const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
#           endif
			llassert(face_data.isMap());

			llassert(face_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
			llassert(face_data[MATERIALS_CAP_OBJECT_ID_FIELD].isInteger());
			// U32 local_id = face_data[MATERIALS_CAP_OBJECT_ID_FIELD].asInteger();

			llassert(face_data.has(MATERIALS_CAP_FACE_FIELD));
			llassert(face_data[MATERIALS_CAP_FACE_FIELD].isInteger());
			// S32 te = face_data[MATERIALS_CAP_FACE_FIELD].asInteger();

			llassert(face_data.has(MATERIALS_CAP_MATERIAL_ID_FIELD));
			llassert(face_data[MATERIALS_CAP_MATERIAL_ID_FIELD].isBinary());
			// LLMaterialID material_id(face_data[MATERIALS_CAP_MATERIAL_ID_FIELD].asBinary());

			// *TODO: do we really still need to process this?
		}
	}
}
Пример #30
0
// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object
bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map, LLWebBrowserCtrl *brws)
{
	LLUUID task_id = tokens[0].asUUID();
	std::string name = query_map["name"].asString();
	std::string slurl = query_map["slurl"].asString();
	LLUUID owner = query_map["owner"].asUUID();
	bool group_owned = query_map.has("groupowned");
	LLUUID region_id = query_map["regionid"].asUUID();
	std::string localpart = query_map["localpos"].asString();
	
	LLObjectIMInfo::show(task_id,name,slurl,owner,group_owned,region_id,localpart);

	return true;
}