From a68e2fe1692a7611c58f774ac5b94c4298343433 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 5 Oct 2012 15:16:30 +0100 Subject: transposing preload sound onto sound module --- .../CoreModules/World/Sound/SoundModuleNonShared.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs index 670794d..0225d6f 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; +using System.Collections.Generic; using System.Reflection; using Nini.Config; @@ -223,6 +224,25 @@ namespace OpenSim.Region.CoreModules.World.Sound } } + public virtual void PreloadSound(UUID soundID, UUID objectID, float radius) + { + SceneObjectPart part; + if (soundID == UUID.Zero + || !m_scene.TryGetSceneObjectPart(objectID, out part)) + { + return; + } + + if (radius == 0) + radius = MaxDistance; + + m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) + { + if (!(Util.GetDistanceTo(sp.AbsolutePosition, part.AbsolutePosition) >= MaxDistance)) + sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); + }); + } + #endregion } } -- cgit v1.1