diff options
author | UbitUmarov | 2015-08-27 15:01:15 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-27 15:01:15 +0100 |
commit | b82b16c954a0f3921efbdcfe7d7eb378f71e96be (patch) | |
tree | 6bc64951ebdc7c6ec691c2e588d8c21ffda4bd21 /OpenSim/Region/Framework/Scenes/EventManager.cs | |
parent | minor clear. Use isTainted in is read clear form (diff) | |
download | opensim-SC_OLD-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.zip opensim-SC_OLD-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.gz opensim-SC_OLD-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.bz2 opensim-SC_OLD-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.xz |
take taints check terrain out of Onframe event and add a new event for it. Slow it down to 1/4 heartbeat rate (once every 363ms aprox)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 692e0c9..24fbef9 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -80,6 +80,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
80 | public event OnTerrainTaintedDelegate OnTerrainTainted; | 80 | public event OnTerrainTaintedDelegate OnTerrainTainted; |
81 | 81 | ||
82 | public delegate void OnTerrainTickDelegate(); | 82 | public delegate void OnTerrainTickDelegate(); |
83 | public delegate void OnTerrainCheckUpdatesDelegate(); | ||
83 | 84 | ||
84 | /// <summary> | 85 | /// <summary> |
85 | /// Triggered if the terrain has been edited | 86 | /// Triggered if the terrain has been edited |
@@ -89,6 +90,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
89 | /// but is used by core solely to update the physics engine. | 90 | /// but is used by core solely to update the physics engine. |
90 | /// </remarks> | 91 | /// </remarks> |
91 | public event OnTerrainTickDelegate OnTerrainTick; | 92 | public event OnTerrainTickDelegate OnTerrainTick; |
93 | public event OnTerrainCheckUpdatesDelegate OnTerrainCheckUpdates; | ||
92 | 94 | ||
93 | public delegate void OnTerrainUpdateDelegate(); | 95 | public delegate void OnTerrainUpdateDelegate(); |
94 | 96 | ||
@@ -1484,6 +1486,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1484 | } | 1486 | } |
1485 | } | 1487 | } |
1486 | 1488 | ||
1489 | public void TriggerTerrainCheckUpdates() | ||
1490 | { | ||
1491 | OnTerrainCheckUpdatesDelegate TerrainCheckUpdates = OnTerrainCheckUpdates; | ||
1492 | if (TerrainCheckUpdates != null) | ||
1493 | { | ||
1494 | foreach (OnTerrainCheckUpdatesDelegate d in TerrainCheckUpdates.GetInvocationList()) | ||
1495 | { | ||
1496 | try | ||
1497 | { | ||
1498 | d(); | ||
1499 | } | ||
1500 | catch (Exception e) | ||
1501 | { | ||
1502 | m_log.ErrorFormat( | ||
1503 | "[EVENT MANAGER]: Delegate for TerrainCheckUpdates failed - continuing. {0} {1}", | ||
1504 | e.Message, e.StackTrace); | ||
1505 | } | ||
1506 | } | ||
1507 | } | ||
1508 | } | ||
1509 | |||
1487 | public void TriggerTerrainTainted() | 1510 | public void TriggerTerrainTainted() |
1488 | { | 1511 | { |
1489 | OnTerrainTaintedDelegate handlerTerrainTainted = OnTerrainTainted; | 1512 | OnTerrainTaintedDelegate handlerTerrainTainted = OnTerrainTainted; |