Commits

Anonymous committed a9a2bba

ER-944: Add feature to control user sounds on a parcel. Added new checkboxes
to the About Land / Sound tab. Reviewed by Kelly.

  • Participants
  • Parent commits 19cf781

Comments (0)

Files changed (8)

indra/llinventory/llparcel.cpp

 	setPreviousOwnerID(LLUUID::null);
 	setPreviouslyGroupOwned(FALSE);
 
-	setHiddenAVs(false);
-	setHaveHiddenAVsData(false);
+	setHiddenAVs(FALSE);
+	setAllowGroupAVSounds(TRUE);
+	setAllowAnyAVSounds(TRUE);
+	setHaveNewParcelLimitData(FALSE);
 }
 
 void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned)
 	msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt);
 	msg["landing_type"] = (U8)mLandingType;
 	msg["hidden_avs"] = (LLSD::Boolean) getHiddenAVs();
+	msg["group_av_sounds"] = (LLSD::Boolean) getAllowGroupAVSounds();
+	msg["any_av_sounds"] = (LLSD::Boolean) getAllowAnyAVSounds();
 }
 
 
     setMediaURL(buffer);
     
 	BOOL hidden_avs = FALSE;
-	bool have_hidden_av_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_HiddenAVs) > 0);
-	if (have_hidden_av_data)
+	BOOL any_av_sounds = TRUE;
+	BOOL group_av_sounds = TRUE;
+	bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_HiddenAVs) > 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_HiddenAVs, hidden_avs);
+		msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds, any_av_sounds);
+		msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds, group_av_sounds);
 	}
 	setHiddenAVs((bool) hidden_avs);
-	setHaveHiddenAVsData(have_hidden_av_data);
+	setAllowAnyAVSounds((bool) any_av_sounds);
+	setAllowGroupAVSounds((bool) group_av_sounds);
+
+	setHaveNewParcelLimitData(have_new_parcel_limit_data);
 
     // non-optimized version
     msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );

indra/llinventory/llparcel.h

 	void setUserLocation(const LLVector3& pos)	{ mUserLocation = pos; }
 	void setUserLookAt(const LLVector3& rot)	{ mUserLookAt = rot; }
 	void setLandingType(const ELandingType type) { mLandingType = type; }
-	void setHiddenAVs(bool hidden_avs)	{ mHiddenAVs = hidden_avs;	}
-	void setHaveHiddenAVsData(bool have_hidden_av_data)		{ mHaveHiddenAVData = have_hidden_av_data;		}		// Remove this once hidden AV feature is fully available grid-wide
+	void setHiddenAVs(BOOL hidden_avs)	{ mHiddenAVs = hidden_avs;	}
+	void setHaveNewParcelLimitData(bool have_new_parcel_data)		{ mHaveNewParcelLimitData = have_new_parcel_data;		}		// Remove this once hidden AV feature is fully available grid-wide
 
 	void setAuctionID(U32 auction_id) { mAuctionID = auction_id;}
 
 	void	setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); }
 	void	setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); }
 	void	setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); }
+	void	setAllowGroupAVSounds(BOOL b)	{ mAllowGroupAVSounds = b;		}
+	void	setAllowAnyAVSounds(BOOL b)		{ mAllowAnyAVSounds = b;		}
 
 	void	setDrawDistance(F32 dist)	{ mDrawDistance = dist; }
 	void	setSalePrice(S32 price)		{ mSalePrice = price; }
 	const LLVector3& getUserLocation() const	{ return mUserLocation; }
 	const LLVector3& getUserLookAt() const	{ return mUserLookAt; }
 	ELandingType getLandingType() const	{ return mLandingType; }
-	bool getHiddenAVs() const			{ return mHiddenAVs;		}
-	bool getHaveHiddenAVsData() const	{ return mHaveHiddenAVData;	}
+	BOOL getHiddenAVs() const			{ return mHiddenAVs;		}
+	BOOL getHaveNewParcelLimitData() const		{ return mHaveNewParcelLimitData;	}
 
 	// User-specified snapshot
 	const LLUUID&	getSnapshotID() const		{ return mSnapshotID; }
 	BOOL	getRegionDenyAgeUnverifiedOverride() const
 					{ return mRegionDenyAgeUnverifiedOverride; }
 
+	BOOL	getAllowGroupAVSounds()	const	{ return mAllowGroupAVSounds;	} 
+	BOOL	getAllowAnyAVSounds()	const	{ return mAllowAnyAVSounds;		}
+
 	F32		getDrawDistance() const			{ return mDrawDistance; }
 	S32		getSalePrice() const			{ return mSalePrice; }
 	time_t	getClaimDate() const			{ return mClaimDate; }
 	LLVector3 mUserLocation;
 	LLVector3 mUserLookAt;
 	ELandingType mLandingType;
-	bool mHiddenAVs;				// Avatars are hidden on this parcel from outside it
-	bool mHaveHiddenAVData;			// Remove once hidden AV feature is grid-wide
+	BOOL mHiddenAVs;				// Avatars are hidden on this parcel from outside it
+	BOOL mHaveNewParcelLimitData;			// Remove once hidden AV feature is grid-wide
 	LLTimer mSaleTimerExpires;
 	LLTimer mMediaResetTimer;
 
 	BOOL				mRegionPushOverride;
 	BOOL				mRegionDenyAnonymousOverride;
 	BOOL				mRegionDenyAgeUnverifiedOverride;
+	BOOL				mAllowGroupAVSounds;
+	BOOL				mAllowAnyAVSounds;
 	
 	ParcelQuota			mQuota;
 	

indra/llmessage/message_prehash.cpp

 char const* const _PREHASH_StatusData = LLMessageStringTable::getInstance()->getString("StatusData");
 char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->getString("ProductSKU");
 char const* const _PREHASH_HiddenAVs = LLMessageStringTable::getInstance()->getString("HiddenAVs");
+char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds");
+char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds");

indra/llmessage/message_prehash.h

 extern char const* const _PREHASH_StatusData;
 extern char const* const _PREHASH_ProductSKU;
 extern char const* const _PREHASH_HiddenAVs;
+extern char const* const _PREHASH_AnyAVSounds;
+extern char const* const _PREHASH_GroupAVSounds;
 #endif

indra/newview/llfloaterland.cpp

 
 		mPrivateParcelCtrl->set(parcel->getHiddenAVs());
 		mPrivateParcelCtrl->setLabel(getString("hidden_avs_text"));
-		mPrivateParcelCtrl->setEnabled(can_change_options && parcel->getHaveHiddenAVsData());
+		mPrivateParcelCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData());
 
 		BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, 
 														GP_LAND_SET_LANDING_POINT);

indra/newview/llpanellandaudio.cpp

 	mMusicURLEdit = getChild<LLLineEditor>("music_url");
 	childSetCommitCallback("music_url", onCommitAny, this);
 
+	mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check");
+	childSetCommitCallback("all av sound check", onCommitAny, this);
+
+	mCheckAVSoundGroup = getChild<LLCheckBoxCtrl>("group av sound check");
+	childSetCommitCallback("group av sound check", onCommitAny, this);
+
 	return TRUE;
 }
 
 
 		mMusicURLEdit->setText(parcel->getMusicURL());
 		mMusicURLEdit->setEnabled( can_change_media );
+
+		BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData();
+		mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds());
+		mCheckAVSoundAny->setEnabled(can_change_av_sounds);
+
+		mCheckAVSoundGroup->set(parcel->getAllowGroupAVSounds() || parcel->getAllowAnyAVSounds());	// On if "Everyone" is on
+		mCheckAVSoundGroup->setEnabled(can_change_av_sounds && !parcel->getAllowAnyAVSounds());		// Enabled if "Everyone" is off
 	}
 }
 // static
 	BOOL voice_enabled = self->mCheckParcelEnableVoice->get();
 	BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get();
 
+	BOOL any_av_sound		= self->mCheckAVSoundAny->get();
+	BOOL group_av_sound		= TRUE;		// If set to "Everyone" then group is checked as well
+	if (!any_av_sound)
+	{	// If "Everyone" is off, use the value from the checkbox
+		group_av_sound = self->mCheckAVSoundGroup->get();
+	}
+
 	// Remove leading/trailing whitespace (common when copying/pasting)
 	LLStringUtil::trim(music_url);
 
 	parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
 	parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
 	parcel->setMusicURL(music_url);
+	parcel->setAllowAnyAVSounds(any_av_sound);
+	parcel->setAllowGroupAVSounds(group_av_sound);
 
 	// Send current parcel data upstream to server
 	LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );

indra/newview/llpanellandaudio.h

 	LLCheckBoxCtrl* mCheckParcelVoiceLocal;	
 	LLLineEditor*	mMusicURLEdit;
 	LLCheckBoxCtrl* mMusicUrlCheck;
+	LLCheckBoxCtrl* mCheckAVSoundAny;
+	LLCheckBoxCtrl* mCheckAVSoundGroup;
 
 	LLSafeHandle<LLParcelSelection>&	mParcel;
 };

indra/newview/skins/default/xui/en/floater_about_land.xml

              name="check sound local"
              left_pad="0"
              width="292" />
+          <text
+             type="string"
+             length="1"
+             follows="left|top"
+             height="16"
+             layout="topleft"
+             left="10"
+             name="Avatar Sounds:"
+             top_pad="10"
+             width="100">
+               Avatar Sounds:
+          </text>
+          <check_box
+             height="16"
+             label="Everyone"
+             layout="topleft"
+             left_pad="0"
+             name="all av sound check"
+             top_delta="0"
+             width="130" />
+          <check_box
+             height="16"
+             label="Group"
+             layout="topleft"
+             left_pad="0"
+             name="group av sound check"
+             top_delta="0"
+             width="70" />
             <text
              type="string"
              length="1"