restrict other avatar sounds to parcel flags ( untested )
parent
d6dbfd1687
commit
17f9f1c247
|
@ -139,14 +139,25 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
if (part.SoundQueueing)
|
if (part.SoundQueueing)
|
||||||
flags |= (byte)SoundFlags.QUEUE;
|
flags |= (byte)SoundFlags.QUEUE;
|
||||||
|
|
||||||
|
if (grp.IsAttachment)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (grp.IsAttachment)
|
|
||||||
{
|
|
||||||
if (grp.HasPrivateAttachmentPoint && sp.ControllingClient.AgentId != grp.OwnerID)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// no radius ?
|
|
||||||
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
|
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
|
||||||
ownerID, (float)gain, flags);
|
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)
|
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
|
||||||
{
|
{
|
||||||
SceneObjectPart part;
|
SceneObjectPart part;
|
||||||
|
ScenePresence ssp = null;
|
||||||
if (!m_scene.TryGetSceneObjectPart(objectID, out part))
|
if (!m_scene.TryGetSceneObjectPart(objectID, out part))
|
||||||
{
|
{
|
||||||
ScenePresence sp;
|
if (!m_scene.TryGetScenePresence(ownerID, out ssp))
|
||||||
if (!m_scene.TryGetScenePresence(ownerID, out sp))
|
return;
|
||||||
|
if (!ssp.ParcelAllowThisAvatarSounds)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SceneObjectGroup grp = part.ParentGroup;
|
SceneObjectGroup grp = part.ParentGroup;
|
||||||
|
|
||||||
if (grp.IsAttachment && grp.HasPrivateAttachmentPoint)
|
if (grp.IsAttachment)
|
||||||
{
|
{
|
||||||
// objectID = ownerID;
|
if (!m_scene.TryGetScenePresence(grp.AttachedAvatar, out ssp))
|
||||||
parentID = ownerID;
|
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))
|
if (!m_scene.TryGetSceneObjectPart(objectID, out m_host))
|
||||||
return;
|
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
|
byte iflags = 1; // looping
|
||||||
if (isMaster)
|
if (isMaster)
|
||||||
iflags |= (byte)SoundFlags.SYNC_MASTER;
|
iflags |= (byte)SoundFlags.SYNC_MASTER;
|
||||||
|
|
|
@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ParcelAllowSounds
|
public bool ParcelAllowThisAvatarSounds
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -5064,7 +5064,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool candoparcelSound = ParcelAllowSounds;
|
bool candoparcelSound = ParcelAllowThisAvatarSounds;
|
||||||
|
|
||||||
foreach (uint id in coldata.Keys)
|
foreach (uint id in coldata.Keys)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue