restrict other avatar sounds to parcel flags ( untested )

avinationmerge
UbitUmarov 2014-07-30 16:32:25 +01:00
parent d6dbfd1687
commit 17f9f1c247
2 changed files with 37 additions and 20 deletions

View File

@ -139,14 +139,25 @@ namespace OpenSim.Region.CoreModules.World.Sound
if (part.SoundQueueing)
flags |= (byte)SoundFlags.QUEUE;
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (grp.IsAttachment)
{
if (grp.HasPrivateAttachmentPoint && sp.ControllingClient.AgentId != grp.OwnerID)
ScenePresence ssp = null;
if (!m_scene.TryGetScenePresence(grp.AttachedAvatar, out ssp))
return;
if (!ssp.ParcelAllowThisAvatarSounds)
return;
if (grp.HasPrivateAttachmentPoint)
{
ssp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
ownerID, (float)gain, flags);
return;
}
// no radius ?
}
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
ownerID, (float)gain, flags);
});
@ -156,20 +167,33 @@ namespace OpenSim.Region.CoreModules.World.Sound
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
{
SceneObjectPart part;
ScenePresence ssp = null;
if (!m_scene.TryGetSceneObjectPart(objectID, out part))
{
ScenePresence sp;
if (!m_scene.TryGetScenePresence(ownerID, out sp))
if (!m_scene.TryGetScenePresence(ownerID, out ssp))
return;
if (!ssp.ParcelAllowThisAvatarSounds)
return;
}
else
{
SceneObjectGroup grp = part.ParentGroup;
if (grp.IsAttachment && grp.HasPrivateAttachmentPoint)
if (grp.IsAttachment)
{
// objectID = ownerID;
parentID = ownerID;
if (!m_scene.TryGetScenePresence(grp.AttachedAvatar, out ssp))
return;
if (!ssp.ParcelAllowThisAvatarSounds)
return;
if (grp.HasPrivateAttachmentPoint)
{
ssp.ControllingClient.SendTriggeredSound(soundId, ownerID,
objectID, parentID, handle, position,
(float)gain);
return;
}
}
}
@ -242,13 +266,6 @@ namespace OpenSim.Region.CoreModules.World.Sound
if (!m_scene.TryGetSceneObjectPart(objectID, out m_host))
return;
// if (isMaster)
// m_host.ParentGroup.LoopSoundMasterPrim = m_host;
// sl does not stop previus sound, volume changes don't work (wiki)
// if (m_host.Sound != UUID.Zero)
// StopSound(m_host);
byte iflags = 1; // looping
if (isMaster)
iflags |= (byte)SoundFlags.SYNC_MASTER;

View File

@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public bool ParcelAllowSounds
public bool ParcelAllowThisAvatarSounds
{
get
{
@ -5064,7 +5064,7 @@ namespace OpenSim.Region.Framework.Scenes
else
{
bool candoparcelSound = ParcelAllowSounds;
bool candoparcelSound = ParcelAllowThisAvatarSounds;
foreach (uint id in coldata.Keys)
{