shuffling code around so that the interface for ISoundModule.SendSound() specifies a UUID rather than a string

This commit is contained in:
SignpostMarv
2012-10-16 12:40:21 +01:00
committed by Justin Clark-Casey (justincc)
parent 5abcecc735
commit c5af16aef8
5 changed files with 47 additions and 28 deletions

View File

@@ -278,10 +278,13 @@ namespace OpenSim.Region.CoreModules.World.Sound
m_host.SendFullUpdateToAllClients();
}
public void SendSound(UUID objectID, string sound, double volume,
public void SendSound(UUID objectID, UUID soundID, double volume,
bool triggered, byte flags, float radius, bool useMaster,
bool isMaster)
{
if (soundID == UUID.Zero)
return;
SceneObjectPart part;
if (!m_scene.TryGetSceneObjectPart(objectID, out part))
return;
@@ -290,29 +293,9 @@ namespace OpenSim.Region.CoreModules.World.Sound
UUID parentID = part.ParentGroup.UUID;
UUID soundID = UUID.Zero;
Vector3 position = part.AbsolutePosition; // region local
ulong regionHandle = m_scene.RegionInfo.RegionHandle;
if (!UUID.TryParse(sound, out soundID))
{
// search sound file from inventory
lock (part.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> item in part.TaskInventory)
{
if (item.Value.Type == (int)AssetType.Sound && item.Value.Name == sound)
{
soundID = item.Value.ItemID;
break;
}
}
}
}
if (soundID == UUID.Zero)
return;
if (useMaster)
{
if (isMaster)