aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs29
2 files changed, 46 insertions, 6 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;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d6a1fab..41f8871 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -245,8 +245,8 @@ namespace OpenSim.Region.Framework.Scenes
245 get { return m_defaultDrawDistance; } 245 get { return m_defaultDrawDistance; }
246 } 246 }
247 247
248// protected float m_maxDrawDistance = 512.0f; 248 protected float m_maxDrawDistance = 512.0f;
249 protected float m_maxDrawDistance = 256.0f; 249// protected float m_maxDrawDistance = 256.0f;
250 public float MaxDrawDistance 250 public float MaxDrawDistance
251 { 251 {
252 get { return m_maxDrawDistance; } 252 get { return m_maxDrawDistance; }
@@ -1581,13 +1581,20 @@ namespace OpenSim.Region.Framework.Scenes
1581 EventManager.TriggerRegionHeartbeatStart(this); 1581 EventManager.TriggerRegionHeartbeatStart(this);
1582 1582
1583 // Apply taints in terrain module to terrain in physics scene 1583 // Apply taints in terrain module to terrain in physics scene
1584
1585 tmpMS = Util.EnvironmentTickCount();
1586 if (Frame % 4 == 0)
1587 {
1588 CheckTerrainUpdates();
1589 }
1590
1584 if (Frame % m_update_terrain == 0) 1591 if (Frame % m_update_terrain == 0)
1585 { 1592 {
1586 tmpMS = Util.EnvironmentTickCount();
1587 UpdateTerrain(); 1593 UpdateTerrain();
1588 terrainMS = Util.EnvironmentTickCountSubtract(tmpMS);
1589 } 1594 }
1590 1595
1596 terrainMS = Util.EnvironmentTickCountSubtract(tmpMS);
1597
1591 tmpMS = Util.EnvironmentTickCount(); 1598 tmpMS = Util.EnvironmentTickCount();
1592 if (PhysicsEnabled && Frame % m_update_physics == 0) 1599 if (PhysicsEnabled && Frame % m_update_physics == 0)
1593 m_sceneGraph.UpdatePreparePhysics(); 1600 m_sceneGraph.UpdatePreparePhysics();
@@ -1809,6 +1816,11 @@ namespace OpenSim.Region.Framework.Scenes
1809 EventManager.TriggerTerrainTick(); 1816 EventManager.TriggerTerrainTick();
1810 } 1817 }
1811 1818
1819 private void CheckTerrainUpdates()
1820 {
1821 EventManager.TriggerTerrainCheckUpdates();
1822 }
1823
1812 /// <summary> 1824 /// <summary>
1813 /// Back up queued up changes 1825 /// Back up queued up changes
1814 /// </summary> 1826 /// </summary>
@@ -5880,11 +5892,12 @@ Environment.Exit(1);
5880 /// or corssing the broder walking, but will NOT prevent 5892 /// or corssing the broder walking, but will NOT prevent
5881 /// child agent creation, thereby emulating the SL behavior. 5893 /// child agent creation, thereby emulating the SL behavior.
5882 /// </remarks> 5894 /// </remarks>
5883 /// <param name='agentID'></param> 5895 /// <param name='agentID'>The visitor's User ID</param>
5896 /// <param name="agentHomeURI">The visitor's Home URI (may be null)</param>
5884 /// <param name='position'></param> 5897 /// <param name='position'></param>
5885 /// <param name='reason'></param> 5898 /// <param name='reason'></param>
5886 /// <returns></returns> 5899 /// <returns></returns>
5887 public bool QueryAccess(UUID agentID, Vector3 position, out string reason) 5900 public bool QueryAccess(UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string reason)
5888 { 5901 {
5889 reason = "You are banned from the region"; 5902 reason = "You are banned from the region";
5890 5903
@@ -5894,6 +5907,10 @@ Environment.Exit(1);
5894 return true; 5907 return true;
5895 } 5908 }
5896 5909
5910
5911// if (!AllowAvatarCrossing && !viaTeleport)
5912// return false;
5913
5897 // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check. 5914 // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check.
5898 // However, the long term fix is to make sure root agent count is always accurate. 5915 // However, the long term fix is to make sure root agent count is always accurate.
5899 m_sceneGraph.RecalculateStats(); 5916 m_sceneGraph.RecalculateStats();