From 5d0a1656bf8d31ef3bbfaf6c0fc1de55d11bc597 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 10 Apr 2018 03:58:54 +0100 Subject: mantis 8305: add osTriggerSoundLimited(..) --- .../Shared/Api/Implementation/OSSL_Api.cs | 20 ++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 7 +++++++ 3 files changed, 29 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d81054e..06f4fd1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -4965,6 +4965,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_SoundModule.SendSound(sop.UUID, soundID, volume, true, 0, 0, false, false); } + public void osTriggerSoundLimited(LSL_Integer linknum, LSL_String sound, LSL_Float volume, + LSL_Vector top_north_east, LSL_Vector bottom_south_west) + { + m_host.AddScriptLPS(1); + + if (m_SoundModule == null) + return; + + SceneObjectPart sop = GetSingleLinkPart(linknum); + if(sop == null) + return; + + UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound); + if(soundID == UUID.Zero) + return; + + m_SoundModule.TriggerSoundLimited(sop.UUID, soundID, volume, + bottom_south_west, top_north_east); + } + public void osStopSound(LSL_Integer linknum) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 818c1c4..4c12bd9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -523,5 +523,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetSoundRadius(LSL_Integer linknum, LSL_Float radius); void osStopSound(LSL_Integer linknum); void osTriggerSound(LSL_Integer linknum, LSL_String sound, LSL_Float volume); + void osTriggerSoundLimited(LSL_Integer linknum, LSL_String sound, LSL_Float volume, + vector top_north_east, vector bottom_south_west); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index aa37159..dd0fa6e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1256,6 +1256,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osTriggerSound(linknum, sound, volume); } + public void osTriggerSoundLimited(LSL_Integer linknum, LSL_String sound, LSL_Float volume, + vector top_north_east, vector bottom_south_west) + { + m_OSSL_Functions.osTriggerSoundLimited(linknum, sound, volume, + top_north_east, bottom_south_west); + } + public void osStopSound(LSL_Integer linknum) { m_OSSL_Functions.osStopSound(linknum); -- cgit v1.1