diff options
author | UbitUmarov | 2017-07-09 00:14:30 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-09 00:14:30 +0100 |
commit | cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036 (patch) | |
tree | 67beed0666a796ae8b7a02bcb78e438a745e9fb7 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | bug fix: dynamic testures set to ALL_SIDES, preserve other face data already ... (diff) | |
download | opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.zip opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.gz opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.bz2 opensim-SC-cc5d6f6b7bcf23b698d1d6a98b60d04bc5ecb036.tar.xz |
throttle collision sounds on a SOG.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index fdfe8ae..bf915e0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1259,6 +1259,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1259 | set { m_LoopSoundSlavePrims = value; } | 1259 | set { m_LoopSoundSlavePrims = value; } |
1260 | } | 1260 | } |
1261 | 1261 | ||
1262 | private double m_lastCollisionSoundMS; | ||
1263 | |||
1262 | /// <summary> | 1264 | /// <summary> |
1263 | /// The UUID for the region this object is in. | 1265 | /// The UUID for the region this object is in. |
1264 | /// </summary> | 1266 | /// </summary> |
@@ -1336,7 +1338,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1336 | /// </summary> | 1338 | /// </summary> |
1337 | public SceneObjectGroup() | 1339 | public SceneObjectGroup() |
1338 | { | 1340 | { |
1339 | 1341 | m_lastCollisionSoundMS = Util.GetTimeStampMS() + 1000.0; | |
1340 | } | 1342 | } |
1341 | 1343 | ||
1342 | /// <summary> | 1344 | /// <summary> |
@@ -5528,7 +5530,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
5528 | } | 5530 | } |
5529 | } | 5531 | } |
5530 | 5532 | ||
5533 | public bool CollisionSoundThrootled(int collisionSoundType) | ||
5534 | { | ||
5535 | double time = m_lastCollisionSoundMS; | ||
5536 | // m_lastCollisionSoundMS = Util.GetTimeStampMS(); | ||
5537 | // time = m_lastCollisionSoundMS - time; | ||
5538 | double now = Util.GetTimeStampMS(); | ||
5539 | time = now - time; | ||
5540 | switch (collisionSoundType) | ||
5541 | { | ||
5542 | case 0: // default sounds | ||
5543 | case 2: // default sounds with volume set by script | ||
5544 | if(time < 300.0) | ||
5545 | return true; | ||
5546 | break; | ||
5547 | case 1: // selected sound | ||
5548 | if(time < 200.0) | ||
5549 | return true; | ||
5550 | break; | ||
5551 | default: | ||
5552 | break; | ||
5553 | } | ||
5554 | m_lastCollisionSoundMS = now; | ||
5555 | return false; | ||
5556 | } | ||
5557 | |||
5531 | #endregion | 5558 | #endregion |
5532 | } | 5559 | } |
5533 | 5560 | ||
5561 | |||
5534 | } | 5562 | } |