aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs152
1 files changed, 0 insertions, 152 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 248679b..b7f4291 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2895,38 +2895,6 @@ namespace OpenSim.Region.Framework.Scenes
2895 ScheduleTerseUpdate(); 2895 ScheduleTerseUpdate();
2896 } 2896 }
2897 2897
2898 public void PreloadSound(string sound)
2899 {
2900 // UUID ownerID = OwnerID;
2901 UUID objectID = ParentGroup.RootPart.UUID;
2902 UUID soundID = UUID.Zero;
2903
2904 if (!UUID.TryParse(sound, out soundID))
2905 {
2906 //Trys to fetch sound id from prim's inventory.
2907 //Prim's inventory doesn't support non script items yet
2908
2909 TaskInventory.LockItemsForRead(true);
2910
2911 foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
2912 {
2913 if (item.Value.Name == sound)
2914 {
2915 soundID = item.Value.ItemID;
2916 break;
2917 }
2918 }
2919
2920 TaskInventory.LockItemsForRead(false);
2921 }
2922
2923 ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
2924 {
2925 if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
2926 sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2927 });
2928 }
2929
2930 public void RemFlag(PrimFlags flag) 2898 public void RemFlag(PrimFlags flag)
2931 { 2899 {
2932 // PrimFlags prevflag = Flags; 2900 // PrimFlags prevflag = Flags;
@@ -3298,126 +3266,6 @@ namespace OpenSim.Region.Framework.Scenes
3298 } 3266 }
3299 3267
3300 /// <summary> 3268 /// <summary>
3301 /// Trigger or play an attached sound in this part's inventory.
3302 /// </summary>
3303 /// <param name="sound"></param>
3304 /// <param name="volume"></param>
3305 /// <param name="triggered"></param>
3306 /// <param name="flags"></param>
3307 public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
3308 {
3309 if (volume > 1)
3310 volume = 1;
3311 if (volume < 0)
3312 volume = 0;
3313
3314 UUID ownerID = OwnerID;
3315 UUID objectID = ParentGroup.RootPart.UUID;
3316 UUID parentID = ParentGroup.UUID;
3317
3318 UUID soundID = UUID.Zero;
3319 Vector3 position = AbsolutePosition; // region local
3320 ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
3321
3322 if (!UUID.TryParse(sound, out soundID))
3323 {
3324 // search sound file from inventory
3325 TaskInventory.LockItemsForRead(true);
3326 foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
3327 {
3328 if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
3329 {
3330 soundID = item.Value.ItemID;
3331 break;
3332 }
3333 }
3334 TaskInventory.LockItemsForRead(false);
3335 }
3336
3337 if (soundID == UUID.Zero)
3338 return;
3339
3340 ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>();
3341 if (soundModule != null)
3342 {
3343 if (useMaster)
3344 {
3345 if (isMaster)
3346 {
3347 if (triggered)
3348 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3349 else
3350 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3351 ParentGroup.PlaySoundMasterPrim = this;
3352 ownerID = OwnerID;
3353 objectID = ParentGroup.RootPart.UUID;
3354 parentID = ParentGroup.UUID;
3355 position = AbsolutePosition; // region local
3356 regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
3357 if (triggered)
3358 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3359 else
3360 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3361 foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
3362 {
3363 ownerID = prim.OwnerID;
3364 objectID = prim.ParentGroup.RootPart.UUID;
3365 parentID = prim.ParentGroup.UUID;
3366 position = prim.AbsolutePosition; // region local
3367 regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
3368 if (triggered)
3369 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3370 else
3371 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3372 }
3373 ParentGroup.PlaySoundSlavePrims.Clear();
3374 ParentGroup.PlaySoundMasterPrim = null;
3375 }
3376 else
3377 {
3378 ParentGroup.PlaySoundSlavePrims.Add(this);
3379 }
3380 }
3381 else
3382 {
3383 if (triggered)
3384 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3385 else
3386 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3387 }
3388 }
3389 }
3390
3391 public void SendCollisionSound(UUID soundID, double volume, Vector3 position)
3392 {
3393 if (soundID == UUID.Zero)
3394 return;
3395
3396 ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>();
3397 if (soundModule == null)
3398 return;
3399
3400 if (volume > 1)
3401 volume = 1;
3402 if (volume < 0)
3403 volume = 0;
3404
3405 int now = Util.EnvironmentTickCount();
3406 if(Util.EnvironmentTickCountSubtract(now,LastColSoundSentTime) <200)
3407 return;
3408
3409 LastColSoundSentTime = now;
3410
3411 UUID ownerID = OwnerID;
3412 UUID objectID = ParentGroup.RootPart.UUID;
3413 UUID parentID = ParentGroup.UUID;
3414 ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
3415
3416 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, 0 );
3417 }
3418
3419
3420 /// <summary>
3421 /// Send a terse update to all clients 3269 /// Send a terse update to all clients
3422 /// </summary> 3270 /// </summary>
3423 public void SendTerseUpdateToAllClients() 3271 public void SendTerseUpdateToAllClients()