aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2014-07-30 16:32:25 +0100
committerUbitUmarov2014-07-30 16:32:25 +0100
commit17f9f1c247679363321b73ec75aed890eaf1b778 (patch)
tree16697a72501ba3ee859200074fe3ec9c6105f5fb /OpenSim/Region
parent missing file in commit 5fe1f878372b5490304a2ad7c0a41293ae36aaa0 (diff)
downloadopensim-SC_OLD-17f9f1c247679363321b73ec75aed890eaf1b778.zip
opensim-SC_OLD-17f9f1c247679363321b73ec75aed890eaf1b778.tar.gz
opensim-SC_OLD-17f9f1c247679363321b73ec75aed890eaf1b778.tar.bz2
opensim-SC_OLD-17f9f1c247679363321b73ec75aed890eaf1b778.tar.xz
restrict other avatar sounds to parcel flags ( untested )
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs51
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
2 files changed, 36 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index b43380c..9c99c19 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -139,14 +139,25 @@ namespace OpenSim.Region.CoreModules.World.Sound
139 if (part.SoundQueueing) 139 if (part.SoundQueueing)
140 flags |= (byte)SoundFlags.QUEUE; 140 flags |= (byte)SoundFlags.QUEUE;
141 141
142 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 142 if (grp.IsAttachment)
143 { 143 {
144 if (grp.IsAttachment) 144 ScenePresence ssp = null;
145 if (!m_scene.TryGetScenePresence(grp.AttachedAvatar, out ssp))
146 return;
147
148 if (!ssp.ParcelAllowThisAvatarSounds)
149 return;
150
151 if (grp.HasPrivateAttachmentPoint)
145 { 152 {
146 if (grp.HasPrivateAttachmentPoint && sp.ControllingClient.AgentId != grp.OwnerID) 153 ssp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
147 return; 154 ownerID, (float)gain, flags);
155 return;
148 } 156 }
149// no radius ? 157 }
158
159 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
160 {
150 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, 161 sp.ControllingClient.SendPlayAttachedSound(soundID, objectID,
151 ownerID, (float)gain, flags); 162 ownerID, (float)gain, flags);
152 }); 163 });
@@ -156,20 +167,33 @@ namespace OpenSim.Region.CoreModules.World.Sound
156 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) 167 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
157 { 168 {
158 SceneObjectPart part; 169 SceneObjectPart part;
170 ScenePresence ssp = null;
159 if (!m_scene.TryGetSceneObjectPart(objectID, out part)) 171 if (!m_scene.TryGetSceneObjectPart(objectID, out part))
160 { 172 {
161 ScenePresence sp; 173 if (!m_scene.TryGetScenePresence(ownerID, out ssp))
162 if (!m_scene.TryGetScenePresence(ownerID, out sp)) 174 return;
175 if (!ssp.ParcelAllowThisAvatarSounds)
163 return; 176 return;
164 } 177 }
165 else 178 else
166 { 179 {
167 SceneObjectGroup grp = part.ParentGroup; 180 SceneObjectGroup grp = part.ParentGroup;
168 181
169 if (grp.IsAttachment && grp.HasPrivateAttachmentPoint) 182 if (grp.IsAttachment)
170 { 183 {
171// objectID = ownerID; 184 if (!m_scene.TryGetScenePresence(grp.AttachedAvatar, out ssp))
172 parentID = ownerID; 185 return;
186
187 if (!ssp.ParcelAllowThisAvatarSounds)
188 return;
189
190 if (grp.HasPrivateAttachmentPoint)
191 {
192 ssp.ControllingClient.SendTriggeredSound(soundId, ownerID,
193 objectID, parentID, handle, position,
194 (float)gain);
195 return;
196 }
173 } 197 }
174 } 198 }
175 199
@@ -242,13 +266,6 @@ namespace OpenSim.Region.CoreModules.World.Sound
242 if (!m_scene.TryGetSceneObjectPart(objectID, out m_host)) 266 if (!m_scene.TryGetSceneObjectPart(objectID, out m_host))
243 return; 267 return;
244 268
245// if (isMaster)
246// m_host.ParentGroup.LoopSoundMasterPrim = m_host;
247
248 // sl does not stop previus sound, volume changes don't work (wiki)
249// if (m_host.Sound != UUID.Zero)
250// StopSound(m_host);
251
252 byte iflags = 1; // looping 269 byte iflags = 1; // looping
253 if (isMaster) 270 if (isMaster)
254 iflags |= (byte)SoundFlags.SYNC_MASTER; 271 iflags |= (byte)SoundFlags.SYNC_MASTER;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3c64219..6b627be 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes
482 } 482 }
483 } 483 }
484 484
485 public bool ParcelAllowSounds 485 public bool ParcelAllowThisAvatarSounds
486 { 486 {
487 get 487 get
488 { 488 {
@@ -5064,7 +5064,7 @@ namespace OpenSim.Region.Framework.Scenes
5064 5064
5065 else 5065 else
5066 { 5066 {
5067 bool candoparcelSound = ParcelAllowSounds; 5067 bool candoparcelSound = ParcelAllowThisAvatarSounds;
5068 5068
5069 foreach (uint id in coldata.Keys) 5069 foreach (uint id in coldata.Keys)
5070 { 5070 {