Example #1
0
// vector3
LLSD ll_sd_from_vector3(const LLVector3& vec)
{
	LLSD rv;
	rv.append((F64)vec.mV[VX]);
	rv.append((F64)vec.mV[VY]);
	rv.append((F64)vec.mV[VZ]);
	return rv;
}
Example #2
0
// vector3d
LLSD ll_sd_from_vector3d(const LLVector3d& vec)
{
	LLSD rv;
	rv.append(vec.mdV[VX]);
	rv.append(vec.mdV[VY]);
	rv.append(vec.mdV[VZ]);
	return rv;
}
Example #3
0
// Quaternion
LLSD ll_sd_from_quaternion(const LLQuaternion& quat)
{
	LLSD rv;
	rv.append((F64)quat.mQ[VX]);
	rv.append((F64)quat.mQ[VY]);
	rv.append((F64)quat.mQ[VZ]);
	rv.append((F64)quat.mQ[VW]);
	return rv;
}
Example #4
0
// color4
LLSD ll_sd_from_color4(const LLColor4& c)
{
	LLSD rv;
	rv.append(c.mV[0]);
	rv.append(c.mV[1]);
	rv.append(c.mV[2]);
	rv.append(c.mV[3]);
	return rv;
}
Example #5
0
// static
bool LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent,
									  const LLInventoryItem* item,
									  const LLUUID& im_session_id/* = LLUUID::null*/)

{
	bool res = true;
	llinfos << "LLGiveInventory::giveInventory()" << llendl;
	if (!isInventoryGiveAcceptable(item))
	{
		return false;
	}
	if (item->getPermissions().allowCopyBy(gAgentID))
	{
		// just give it away.
		LLGiveInventory::commitGiveInventoryItem(to_agent, item, im_session_id);
	}
	else
	{
		// ask if the agent is sure.
		LLSD substitutions;
		substitutions["ITEMS"] = item->getName();
		LLSD payload;
		payload["agent_id"] = to_agent;
		LLSD items = LLSD::emptyArray();
		items.append(item->getUUID());
		payload["items"] = items;
		LLNotificationsUtil::add("CannotCopyWarning", substitutions, payload,
			&LLGiveInventory::handleCopyProtectedItem);
		res = false;
	}

	return res;
}
	virtual LLSD simpleGet() const
	{
		LLSD result;
		LLApp* app = LLApp::instance();
		for(int ii = 0; ii < LLApp::PRIORITY_COUNT; ++ii)
		{
			result.append(app->getOptionData((LLApp::OptionPriority)ii));
		}
		return result;
	}
Example #7
0
LLSD LLURI::pathArray() const
{
	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
	boost::char_separator<char> sep("/", "", boost::drop_empty_tokens);
	tokenizer tokens(mEscapedPath, sep);
	tokenizer::iterator it = tokens.begin();
	tokenizer::iterator end = tokens.end();

	LLSD params;
	for ( ; it != end; ++it)
	{
		params.append(*it);
	}
	return params;
}
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
{
	capabilityNames.append("AttachmentResources");
	capabilityNames.append("AvatarPickerSearch");
	capabilityNames.append("ChatSessionRequest");
	capabilityNames.append("CopyInventoryFromNotecard");
	capabilityNames.append("CreateInventoryCategory");
	capabilityNames.append("DispatchRegionInfo");
	capabilityNames.append("EstateChangeInfo");
	capabilityNames.append("EventQueueGet");
	capabilityNames.append("EnvironmentSettings");
	capabilityNames.append("ObjectMedia");
	capabilityNames.append("ObjectMediaNavigate");

	if (gSavedSettings.getBOOL("UseHTTPInventory"))
	{
		capabilityNames.append("FetchLib2");
		capabilityNames.append("FetchLibDescendents2");
		capabilityNames.append("FetchInventory2");
		capabilityNames.append("FetchInventoryDescendents2");
	}

	capabilityNames.append("GetDisplayNames");
	capabilityNames.append("GetTexture");
	capabilityNames.append("GetMesh");
	capabilityNames.append("GetObjectCost");
	capabilityNames.append("GetObjectPhysicsData");
	capabilityNames.append("GroupProposalBallot");
	capabilityNames.append("HomeLocation");
	capabilityNames.append("LandResources");
	capabilityNames.append("MapLayer");
	capabilityNames.append("MapLayerGod");
	capabilityNames.append("MeshUploadFlag");
	capabilityNames.append("NewFileAgentInventory");
	capabilityNames.append("ParcelPropertiesUpdate");
	capabilityNames.append("ParcelNavigateMedia");
	capabilityNames.append("ParcelVoiceInfoRequest");
	capabilityNames.append("ProductInfoRequest");
	capabilityNames.append("ProvisionVoiceAccountRequest");
	capabilityNames.append("RemoteParcelRequest");
	capabilityNames.append("RequestTextureDownload");
	capabilityNames.append("ResourceCostSelected");
	capabilityNames.append("SearchStatRequest");
	capabilityNames.append("SearchStatTracking");
	capabilityNames.append("SendPostcard");
	capabilityNames.append("SendUserReport");
	capabilityNames.append("SendUserReportWithScreenshot");
	capabilityNames.append("ServerReleaseNotes");
	capabilityNames.append("SimConsole");
	capabilityNames.append("SimulatorFeatures");
	capabilityNames.append("SetDisplayName");
	capabilityNames.append("SimConsoleAsync");
	capabilityNames.append("StartGroupProposal");
	capabilityNames.append("TextureStats");
	capabilityNames.append("UntrustedSimulatorMessage");
	capabilityNames.append("UpdateAgentInformation");
	capabilityNames.append("UpdateAgentLanguage");
	capabilityNames.append("UpdateGestureAgentInventory");
	capabilityNames.append("UpdateNotecardAgentInventory");
	capabilityNames.append("UpdateScriptAgent");
	capabilityNames.append("UpdateGestureTaskInventory");
	capabilityNames.append("UpdateNotecardTaskInventory");
	capabilityNames.append("UpdateScriptTask");
	capabilityNames.append("UploadBakedTexture");
	capabilityNames.append("ViewerMetrics");
	capabilityNames.append("ViewerStartAuction");
	capabilityNames.append("ViewerStats");
	
	// Please add new capabilities alphabetically to reduce
	// merge conflicts.
}
LLSD LLUserAuth::parseValues(UserAuthcode &auth_code, const std::string& key_pfx, XMLRPC_VALUE param)
{
	auth_code = E_OK;
	LLSD responses;
	for(XMLRPC_VALUE current = XMLRPC_VectorRewind(param); current;
		current = XMLRPC_VectorNext(param))
	{
		std::string key(XMLRPC_GetValueID(current));
		LL_DEBUGS() << "key: " << key_pfx << key << LL_ENDL;
		XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(current);
		if(xmlrpc_type_string == type)
		{
			LLSD::String val(XMLRPC_GetValueString(current));
			LL_DEBUGS() << "val: " << val << LL_ENDL;
			responses.insert(key,val);
		}
		else if(xmlrpc_type_int == type)
		{
			LLSD::Integer val(XMLRPC_GetValueInt(current));
			LL_DEBUGS() << "val: " << val << LL_ENDL;
			responses.insert(key,val);
		}
		else if (xmlrpc_type_double == type)
        {
			LLSD::Real val(XMLRPC_GetValueDouble(current));
            LL_DEBUGS() << "val: " << val << LL_ENDL;
			responses.insert(key,val);
		}
		else if(xmlrpc_type_array == type)
		{
			// We expect this to be an array of submaps. Walk the array,
			// recursively parsing each submap and collecting them.
			LLSD array;
			int i = 0;          // for descriptive purposes
			for (XMLRPC_VALUE row = XMLRPC_VectorRewind(current); row;
				row = XMLRPC_VectorNext(current), ++i)
			{
				// Recursive call. For the lower-level key_pfx, if 'key'
				// is "foo", pass "foo[0]:", then "foo[1]:", etc. In the
				// nested call, a subkey "bar" will then be logged as
				// "foo[0]:bar", and so forth.
				// Parse the scalar subkey/value pairs from this array
				// entry into a temp submap. Collect such submaps in 'array'.
				std::string key_prefix = key_pfx;
				array.append(parseValues(auth_code,
									STRINGIZE(key_pfx << key << '[' << i << "]:"),
									row));
			}
			// Having collected an 'array' of 'submap's, insert that whole
			// 'array' as the value of this 'key'.
			responses.insert(key, array);
		}
		else if (xmlrpc_type_struct == type)
    	{
    		LLSD submap = parseValues(auth_code,
            						STRINGIZE(key_pfx << key << ':'),
            						current);
            responses.insert(key, submap);
        }
        else
        {
        	// whoops - unrecognized type
            LL_WARNS() << "Unhandled xmlrpc type " << type << " for key "
                                        << key_pfx << key << LL_ENDL;
            responses.insert(key, STRINGIZE("<bad XMLRPC type " << type << '>'));
            auth_code = E_UNHANDLED_ERROR;
        }
    }
    return responses;
}