From 5d0a1656bf8d31ef3bbfaf6c0fc1de55d11bc597 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 10 Apr 2018 03:58:54 +0100 Subject: [PATCH] mantis 8305: add osTriggerSoundLimited(..) --- .../Shared/Api/Implementation/OSSL_Api.cs | 20 +++++++++++++++++++ .../Shared/Api/Interface/IOSSL_Api.cs | 2 ++ .../Shared/Api/Runtime/OSSL_Stub.cs | 7 +++++++ bin/config-include/osslEnable.ini | 1 + 4 files changed, 30 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d81054e72e..06f4fd18c4 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 818c1c4167..4c12bd9cee 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 aa37159699..dd0fa6ed96 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); diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index b7760357e0..71b39b0275 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -276,6 +276,7 @@ ; Allow_osSetSoundRadius = true ; Allow_osStopSound = true ; Allow_osTriggerSound = true +; Allow_osTriggerSoundLimited = true ; Allow_osVecDistSquare = true ; Allow_osVecMagSquare = true ; Allow_osVolumeDetect = true