Esempio n. 1
0
void LLParcel::unpackMessage(LLMessageSystem* msg)
{
	std::string buffer;
	
    msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, buffer );
    setName(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, buffer );
    setDesc(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, buffer );
    setMusicURL(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
    setMediaURL(buffer);
    
    // non-optimized version
    msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );
    
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID );
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice );
    msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours );
    U8 category;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_Category, category);
    mCategory = (ECategory)category;
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID);
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt);
    U8 landing_type;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_LandingType, landing_type);
    mLandingType = (ELandingType)landing_type;

	// New Media Data
	// Note: the message has been converted to TCP
	if(msg->has("MediaData"))
	{
		msg->getString("MediaData", "MediaDesc", buffer);
		setMediaDesc(buffer);
		msg->getString("MediaData", "MediaType", buffer);
		setMediaType(buffer);
		msg->getS32("MediaData", "MediaWidth", mMediaWidth);
		msg->getS32("MediaData", "MediaHeight", mMediaHeight);
		msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
		msg->getU8 ( "MediaData", "ObscureMedia", mObscureMedia );
		msg->getU8 ( "MediaData", "ObscureMusic", mObscureMusic );
	}
	else
	{
		setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
		setMediaDesc(std::string("No Description available without Server Upgrade"));
		mMediaLoop = true;
		mObscureMedia = true;
		mObscureMusic = true;
	}
}
Esempio n. 2
0
void LLParcel::clearParcel()
{
	overrideParcelFlags(PF_DEFAULT);
	setName(LLStringUtil::null);
	setDesc(LLStringUtil::null);
	setMediaURL(LLStringUtil::null);
	setMediaType(LLStringUtil::null);
	setMediaID(LLUUID::null);
    setMediaDesc(LLStringUtil::null);
	setMediaAutoScale(0);
	setMediaLoop(TRUE);
	mMediaWidth = 0;
	mMediaHeight = 0;
	setMediaCurrentURL(LLStringUtil::null);
	setMediaAllowNavigate(TRUE);
	setMediaPreventCameraZoom(FALSE);
	setMediaURLTimeout(0.0f);
	setMusicURL(LLStringUtil::null);
	setInEscrow(FALSE);
	setAuthorizedBuyerID(LLUUID::null);
	setCategory(C_NONE);
	setSnapshotID(LLUUID::null);
	setUserLocation(LLVector3::zero);
	setUserLookAt(LLVector3::x_axis);
	setLandingType(L_LANDING_POINT);
	setAuctionID(0);
	setGroupID(LLUUID::null);
	setPassPrice(0);
	setPassHours(0.f);
	mAccessList.clear();
	mBanList.clear();
	//mRenterList.reset();
}
bool UDiskMountDevice::update()
{
    bool res = false;
    res = setLabel(calcLabel()) || res;
    res = setIsExternal(calcIsExternal()) || res;
    res = setMediaType(calcMediaType()) || res;
    res = setIconName(calcIconName()) || res;

    res = setIsMounted(mDbus->property("DeviceIsMounted").toBool()) || res;

    if (mDbus->property("DeviceIsDrive").toBool())
        res = setIsEjectable(mDbus->property("DriveIsMediaEjectable").toBool());

    res = setSize(mDbus->property("DeviceSize").toULongLong()) || res;
    res = setVendor(mDbus->property("DriveVendor").toString()) || res;
    res = setModel(mDbus->property("DriveModel").toString()) || res;
    res = setFileSystem(mDbus->property("IdType").toString()) || res;

    QStringList paths = mDbus->property("DeviceMountPaths").toStringList();
    if (!paths.empty())
        res = setMountPath(paths.first()) || res;

    if (res)
        emit changed();

    return res;
}
Esempio n. 4
0
void LLParcel::setMediaType(const std::string& type)
{
	// The escaping here must match the escaping in the database
	// abstraction layer.
	mMediaType = type;
	mMediaType = rawstr_to_utf8(mMediaType);

	// This code attempts to preserve legacy movie functioning
	if(mMediaType.empty() && ! mMediaURL.empty())
	{
		setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
	}
}
// public
void LLPanelLandMedia::refresh()
{
	LLParcel *parcel = mParcel->getParcel();

	if (!parcel)
	{
		clearCtrls();
	}
	else
	{
		// something selected, hooray!

		// Display options
		BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);

		mMediaURLEdit->setText(parcel->getMediaURL());
		mMediaURLEdit->setEnabled( FALSE );

		childSetText("current_url", parcel->getMediaCurrentURL());

		mMediaDescEdit->setText(parcel->getMediaDesc());
		mMediaDescEdit->setEnabled( can_change_media );

		std::string mime_type = parcel->getMediaType();
		if (mime_type.empty())
		{
			mime_type = LLMIMETypes::getDefaultMimeType();
		}
		setMediaType(mime_type);
		mMediaTypeCombo->setEnabled( can_change_media );
		childSetText("mime_type", mime_type);

		mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
		mMediaAutoScaleCheck->setEnabled ( can_change_media );

		// Special code to disable looping checkbox for HTML MIME type
		// (DEV-10042 -- Parcel Media: "Loop Media" should be disabled for static media types)
		bool allow_looping = LLMIMETypes::findAllowLooping( mime_type );
		if ( allow_looping )
			mMediaLoopCheck->set( parcel->getMediaLoop () );
		else
			mMediaLoopCheck->set( false );
		mMediaLoopCheck->setEnabled ( can_change_media && allow_looping );
		
		mMediaResetCtrl->set( parcel->getMediaURLTimeout() );
		mMediaResetCtrl->setEnabled( can_change_media );
		mMediaResetCtrlLabel->setEnabled( can_change_media );

		// disallow media size change for mime types that don't allow it
		bool allow_resize = LLMIMETypes::findAllowResize( mime_type );
		if ( allow_resize )
			mMediaWidthCtrl->setValue( parcel->getMediaWidth() );
		else
			mMediaWidthCtrl->setValue( 0 );
		mMediaWidthCtrl->setEnabled ( can_change_media && allow_resize );

		if ( allow_resize )
			mMediaHeightCtrl->setValue( parcel->getMediaHeight() );
		else
			mMediaHeightCtrl->setValue( 0 );
		mMediaHeightCtrl->setEnabled ( can_change_media && allow_resize );

		// enable/disable for text label for completeness
		mMediaSizeCtrlLabel->setEnabled( can_change_media && allow_resize );

		LLUUID tmp = parcel->getMediaID();
		mMediaTextureCtrl->setImageAssetID ( parcel->getMediaID() );
		mMediaTextureCtrl->setEnabled( can_change_media );

		mSetURLButton->setEnabled( can_change_media );
		mResetURLButton->setEnabled( can_change_media );

		/*LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get();
		if (floater_url_entry)
		{
			floater_url_entry->updateFromLandMediaPanel();
		}*/
	}
}
Esempio n. 6
0
void LLParcel::unpackMessage(LLMessageSystem* msg)
{
	std::string buffer;
	
    msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, buffer );
    setName(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, buffer );
    setDesc(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, buffer );
    setMusicURL(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
    setMediaURL(buffer);
    
	BOOL see_avs = TRUE;			// All default to true for legacy server behavior
	BOOL any_av_sounds = TRUE;
	BOOL group_av_sounds = TRUE;
	bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_SeeAVs) > 0);		// New version of server should send all 3 of these values
	have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds) > 0);
	have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds) > 0);
	if (have_new_parcel_limit_data)
	{
		msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_SeeAVs, see_avs);
		msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds, any_av_sounds);
		msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds, group_av_sounds);
	}
	setSeeAVs((bool) see_avs);
	setAllowAnyAVSounds((bool) any_av_sounds);
	setAllowGroupAVSounds((bool) group_av_sounds);

	setHaveNewParcelLimitData(have_new_parcel_limit_data);

    // non-optimized version
    msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );
    
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID );
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice );
    msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours );
    U8 category;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_Category, category);
    mCategory = (ECategory)category;
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID);
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt);
    U8 landing_type;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_LandingType, landing_type);
    mLandingType = (ELandingType)landing_type;

	// New Media Data
	// Note: the message has been converted to TCP
	if(msg->has("MediaData"))
	{
		msg->getString("MediaData", "MediaDesc", buffer);
		setMediaDesc(buffer);
		msg->getString("MediaData", "MediaType", buffer);
		setMediaType(buffer);
		msg->getS32("MediaData", "MediaWidth", mMediaWidth);
		msg->getS32("MediaData", "MediaHeight", mMediaHeight);
		msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
		// the ObscureMedia and ObscureMusic flags previously set here are no longer used
	}
	else
	{
		setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
		setMediaDesc(std::string("No Description available without Server Upgrade"));
		mMediaLoop = true;
	}

	if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
	{
		msg->getString("MediaLinkSharing", "MediaCurrentURL", buffer);
		setMediaCurrentURL(buffer);
		msg->getU8 ( "MediaLinkSharing", "MediaAllowNavigate", mMediaAllowNavigate );
		msg->getU8 ( "MediaLinkSharing", "MediaPreventCameraZoom", mMediaPreventCameraZoom );
		msg->getF32( "MediaLinkSharing", "MediaURLTimeout", mMediaURLTimeout);
	}
	else
	{
		setMediaCurrentURL(LLStringUtil::null);
	}
	
}
Esempio n. 7
0
void LLParcel::init(const LLUUID &owner_id,
                    BOOL modify, BOOL terraform, BOOL damage,
                    time_t claim_date, S32 claim_price_per_meter,
                    S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus,
                    BOOL is_group_owned)
{
	mID.setNull();
	mOwnerID			= owner_id;
	mGroupOwned			= is_group_owned;
	mClaimDate			= claim_date;
	mClaimPricePerMeter	= claim_price_per_meter;
	mRentPricePerMeter	= rent_price_per_meter;
	mArea				= area;
	mDiscountRate		= 1.0f;
	mDrawDistance		= 512.f;

	mUserLookAt.setVec(0.0f, 0.f, 0.f);
	// Default to using the parcel's landing point, if any.
	mLandingType = L_LANDING_POINT;

	// *FIX: if owner_id != null, should be owned or sale pending,
	// investigate init callers.
	mStatus = OS_NONE;
	mCategory = C_NONE;
	mAuthBuyerID.setNull();
	//mBuyerID.setNull();
	//mJoinNeighbors = 0x0;
	mSaleTimerExpires.setTimerExpirySec(0);
	mSaleTimerExpires.stop();
	mGraceExtension = 0;
	//mExpireAction = STEA_REVERT;
	//mRecordTransaction = FALSE;

	mAuctionID = 0;
	mInEscrow = false;

	mParcelFlags = PF_DEFAULT;
	setParcelFlag(PF_CREATE_OBJECTS,  modify);
	setParcelFlag(PF_ALLOW_TERRAFORM, terraform);
	setParcelFlag(PF_ALLOW_DAMAGE,    damage);

	mSalePrice			= 10000;
	setName(LLStringUtil::null);
	setDesc(LLStringUtil::null);
	setMusicURL(LLStringUtil::null);
	setMediaURL(LLStringUtil::null);
	setMediaDesc(LLStringUtil::null);
	setMediaType(LLStringUtil::null);
	mMediaID.setNull();
	mMediaAutoScale = 0;
	mMediaLoop = TRUE;
	mMediaWidth = 0;
	mMediaHeight = 0;
	setMediaCurrentURL(LLStringUtil::null);
	mMediaAllowNavigate = TRUE;
	mMediaURLTimeout = 0.0f;
	mMediaPreventCameraZoom = FALSE;

	mGroupID.setNull();

	mPassPrice = PARCEL_PASS_PRICE_DEFAULT;
	mPassHours = PARCEL_PASS_HOURS_DEFAULT;

	mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER);
	mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER);

	mLocalID = INVALID_PARCEL_ID;

	//mSimWidePrimCorrection = 0;
	setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS)));
	setSimWideMaxPrimCapacity(0);
	setSimWidePrimCount(0);
	setOwnerPrimCount(0);
	setGroupPrimCount(0);
	setOtherPrimCount(0);
	setSelectedPrimCount(0);
	setTempPrimCount(0);
	setCleanOtherTime(0);
    setRegionPushOverride(FALSE);
    setRegionDenyAnonymousOverride(FALSE);
    setRegionDenyAgeUnverifiedOverride(FALSE);
	setParcelPrimBonus(parcel_object_bonus);

	setPreviousOwnerID(LLUUID::null);
	setPreviouslyGroupOwned(FALSE);

	setSeeAVs(TRUE);
	setAllowGroupAVSounds(TRUE);
	setAllowAnyAVSounds(TRUE);
	setHaveNewParcelLimitData(FALSE);
}
// public
void LLPanelLandMedia::refresh()
{
	LLParcel *parcel = mParcel->getParcel();

	if (!parcel)
	{
		clearCtrls();
	}
	else
	{
		// something selected, hooray!

		// Display options
		BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);

		mMediaURLEdit->setText(parcel->getMediaURL());
		mMediaURLEdit->setEnabled( FALSE );

		childSetText("current_url", parcel->getMediaCurrentURL());

		mMediaDescEdit->setText(parcel->getMediaDesc());
		mMediaDescEdit->setEnabled( can_change_media );

		std::string mime_type = parcel->getMediaType();
		if (mime_type.empty())
		{
			mime_type = "none/none";
		}
		setMediaType(mime_type);
		mMediaTypeCombo->setEnabled( can_change_media );
		childSetText("mime_type", mime_type);

		mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
		mMediaAutoScaleCheck->setEnabled ( can_change_media );

		// Special code to disable looping checkbox for HTML MIME type
		// (DEV-10042 -- Parcel Media: "Loop Media" should be disabled for static media types)
		bool allow_looping = LLMIMETypes::findAllowLooping( mime_type );
		if ( allow_looping )
			mMediaLoopCheck->set( parcel->getMediaLoop () );
		else
			mMediaLoopCheck->set( false );
		mMediaLoopCheck->setEnabled ( can_change_media && allow_looping );
		
		mMediaResetCtrl->set( parcel->getMediaURLTimeout() );
		mMediaResetCtrl->setEnabled( can_change_media );
		mMediaResetCtrlLabel->setEnabled( can_change_media );

		// disallow media size change for mime types that don't allow it
		bool allow_resize = LLMIMETypes::findAllowResize( mime_type );
		if ( allow_resize )
			mMediaWidthCtrl->setValue( parcel->getMediaWidth() );
		else
			mMediaWidthCtrl->setValue( 0 );
		mMediaWidthCtrl->setEnabled ( can_change_media && allow_resize );

		if ( allow_resize )
			mMediaHeightCtrl->setValue( parcel->getMediaHeight() );
		else
			mMediaHeightCtrl->setValue( 0 );
		mMediaHeightCtrl->setEnabled ( can_change_media && allow_resize );

		// enable/disable for text label for completeness
		mMediaSizeCtrlLabel->setEnabled( can_change_media && allow_resize );

		LLUUID tmp = parcel->getMediaID();
		mMediaTextureCtrl->setImageAssetID ( parcel->getMediaID() );
		mMediaTextureCtrl->setEnabled( can_change_media );

		mSetURLButton->setEnabled( can_change_media );
		mResetURLButton->setEnabled( can_change_media );

		mMediaURLFilterCheck->set( parcel->getMediaURLFilterEnable() );
		mMediaURLFilterCheck->setEnabled( can_change_media );

		LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get();
		if (floater_url_entry)
		{
			floater_url_entry->updateFromLandMediaPanel();
		}

		// This radial control is really just an inverse mapping to the boolean allow_navigate value. 
		// It is set as a radial merely for user readability.
		mRadioNavigateControl->setSelectedIndex(! parcel->getMediaAllowNavigate());
		mRadioNavigateControl->setEnabled( can_change_media );

		mMediaURLFilterDomainEdit->setEnabled( can_change_media );
		mMediaURLFilterAddButton->setEnabled( can_change_media );
		mMediaURLFilterRemoveButton->setEnabled( can_change_media );

		if (mURLFilterList)
		{
			mURLFilterList->setEnabled( can_change_media );
			
			mURLFilterList->deleteAllItems();

			LLSD list = parcel->getMediaURLFilterList();
			
			for (LLSD::array_iterator i = list.beginArray(); i != list.endArray(); ++i)
			{
				std::string domain = (*i).asString();

				LLSD element;
				element["id"] = domain;
				element["columns"][0]["value"] = domain;
				
				mURLFilterList->addElement(element);
			}
		}
	}
}
Esempio n. 9
0
// public
void LLPanelLandMedia::refresh()
{
	LLParcel *parcel = mParcel->getParcel();

	if (!parcel)
	{
		clearCtrls();
	}
	else
	{
		// something selected, hooray!

		// Display options
		BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);

		mMediaURLEdit->setText(parcel->getMediaURL());
		mMediaURLEdit->setEnabled( FALSE );

		getChild<LLUICtrl>("current_url")->setValue(parcel->getMediaCurrentURL());

		mMediaDescEdit->setText(parcel->getMediaDesc());
		mMediaDescEdit->setEnabled( can_change_media );

		std::string mime_type = parcel->getMediaType();
		if (mime_type.empty() || mime_type == LLMIMETypes::getDefaultMimeType())
		{
			mime_type = LLMIMETypes::getDefaultMimeTypeTranslation();
		}
		setMediaType(mime_type);
		mMediaTypeCombo->setEnabled( can_change_media );
		getChild<LLUICtrl>("mime_type")->setValue(mime_type);

		mMediaUrlCheck->set( parcel->getObscureMedia() );
		mMediaUrlCheck->setEnabled( can_change_media );

		// don't display urls if you're not able to change it
		// much requested change in forums so people can't 'steal' urls
		// NOTE: bug#2009 means this is still vunerable - however, bug
		// should be closed since this bug opens up major security issues elsewhere.
		bool obscure_media = ! can_change_media && parcel->getObscureMedia();

		// Special code to disable asterixes for html type
		if(mime_type == "text/html")
		{
			obscure_media = false;
			mMediaUrlCheck->set( 0 );
			mMediaUrlCheck->setEnabled( false );
		}

		mMediaURLEdit->setDrawAsterixes( obscure_media );

		mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
		mMediaAutoScaleCheck->setEnabled ( can_change_media );

		// Special code to disable looping checkbox for HTML MIME type
		// (DEV-10042 -- Parcel Media: "Loop Media" should be disabled for static media types)
		bool allow_looping = LLMIMETypes::findAllowLooping( mime_type );
		if ( allow_looping )
			mMediaLoopCheck->set( parcel->getMediaLoop () );
		else
			mMediaLoopCheck->set( false );
		mMediaLoopCheck->setEnabled ( can_change_media && allow_looping );
		
		// disallow media size change for mime types that don't allow it
		bool allow_resize = LLMIMETypes::findAllowResize( mime_type );
		if ( allow_resize )
			mMediaWidthCtrl->setValue( parcel->getMediaWidth() );
		else
			mMediaWidthCtrl->setValue( 0 );
		mMediaWidthCtrl->setEnabled ( can_change_media && allow_resize );

		if ( allow_resize )
			mMediaHeightCtrl->setValue( parcel->getMediaHeight() );
		else
			mMediaHeightCtrl->setValue( 0 );
		mMediaHeightCtrl->setEnabled ( can_change_media && allow_resize );

		// enable/disable for text label for completeness
		mMediaSizeCtrlLabel->setEnabled( can_change_media && allow_resize );

		LLUUID tmp = parcel->getMediaID();
		mMediaTextureCtrl->setImageAssetID ( parcel->getMediaID() );
		mMediaTextureCtrl->setEnabled( can_change_media );

		mSetURLButton->setEnabled( can_change_media );

	}
}
Esempio n. 10
0
void LLParcel::unpackMessage(LLMessageSystem* msg)
{
	std::string buffer;
	
    msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, buffer );
    setName(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, buffer );
    setDesc(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, buffer );
    setMusicURL(buffer);
    msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
    setMediaURL(buffer);
    
    // non-optimized version
    msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );
    
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID );
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID );
    msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice );
    msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours );
    U8 category;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_Category, category);
    mCategory = (ECategory)category;
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID);
    msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation);
    msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt);
    U8 landing_type;
    msg->getU8Fast(	 _PREHASH_ParcelData,_PREHASH_LandingType, landing_type);
    mLandingType = (ELandingType)landing_type;

	// New Media Data
	// Note: the message has been converted to TCP
	if(msg->has("MediaData"))
	{
		msg->getString("MediaData", "MediaDesc", buffer);
		setMediaDesc(buffer);
		msg->getString("MediaData", "MediaType", buffer);
		setMediaType(buffer);
		msg->getS32("MediaData", "MediaWidth", mMediaWidth);
		msg->getS32("MediaData", "MediaHeight", mMediaHeight);
		msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
	}
	else
	{
		setMediaType(std::string("")); 	//having mMediaType empty causes autodetect,
						// thats what we want -- AW
		setMediaDesc(std::string("No Description available without Server Upgrade"));
		mMediaLoop = true;
	}

	if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
	{
		msg->getString("MediaLinkSharing", "MediaCurrentURL", buffer);
		setMediaCurrentURL(buffer);
		msg->getU8 ( "MediaLinkSharing", "MediaAllowNavigate", mMediaAllowNavigate );
		msg->getU8 ( "MediaLinkSharing", "MediaURLFilterEnable", mMediaURLFilterEnable );
		msg->getU8 ( "MediaLinkSharing", "MediaPreventCameraZoom", mMediaPreventCameraZoom );
		msg->getF32( "MediaLinkSharing", "MediaURLTimeout", mMediaURLTimeout);
	}
	else
	{
		setMediaCurrentURL(LLStringUtil::null);
	}
	
}