mantis 8305: add osTriggerSoundLimited(..)

httptests
UbitUmarov 2018-04-10 03:58:54 +01:00
parent 8a30d1303d
commit 5d0a1656bf
4 changed files with 30 additions and 0 deletions

View File

@ -4965,6 +4965,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_SoundModule.SendSound(sop.UUID, soundID, volume, true, 0, 0, false, false); 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) public void osStopSound(LSL_Integer linknum)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);

View File

@ -523,5 +523,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetSoundRadius(LSL_Integer linknum, LSL_Float radius); void osSetSoundRadius(LSL_Integer linknum, LSL_Float radius);
void osStopSound(LSL_Integer linknum); void osStopSound(LSL_Integer linknum);
void osTriggerSound(LSL_Integer linknum, LSL_String sound, LSL_Float volume); 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);
} }
} }

View File

@ -1256,6 +1256,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osTriggerSound(linknum, sound, volume); 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) public void osStopSound(LSL_Integer linknum)
{ {
m_OSSL_Functions.osStopSound(linknum); m_OSSL_Functions.osStopSound(linknum);

View File

@ -276,6 +276,7 @@
; Allow_osSetSoundRadius = true ; Allow_osSetSoundRadius = true
; Allow_osStopSound = true ; Allow_osStopSound = true
; Allow_osTriggerSound = true ; Allow_osTriggerSound = true
; Allow_osTriggerSoundLimited = true
; Allow_osVecDistSquare = true ; Allow_osVecDistSquare = true
; Allow_osVecMagSquare = true ; Allow_osVecMagSquare = true
; Allow_osVolumeDetect = true ; Allow_osVolumeDetect = true