diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 49c1ebf..70b11c3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
278 | private bool m_firstHeartbeat = true; | 278 | private bool m_firstHeartbeat = true; |
279 | 279 | ||
280 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | 280 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; |
281 | private bool m_reprioritization_enabled = true; | ||
282 | private double m_reprioritization_interval = 2000.0; | ||
283 | private double m_root_reprioritization_distance = 5.0; | ||
284 | private double m_child_reprioritization_distance = 10.0; | ||
281 | 285 | ||
282 | private object m_deleting_scene_object = new object(); | 286 | private object m_deleting_scene_object = new object(); |
283 | 287 | ||
@@ -291,6 +295,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
291 | #region Properties | 295 | #region Properties |
292 | 296 | ||
293 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return this.m_update_prioritization_scheme; } } | 297 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return this.m_update_prioritization_scheme; } } |
298 | public bool IsReprioritizationEnabled { get { return m_reprioritization_enabled; } } | ||
299 | public double ReprioritizationInterval { get { return m_reprioritization_interval; } } | ||
300 | public double RootReprioritizationDistance { get { return m_root_reprioritization_distance; } } | ||
301 | public double ChildReprioritizationDistance { get { return m_child_reprioritization_distance; } } | ||
294 | 302 | ||
295 | public AgentCircuitManager AuthenticateHandler | 303 | public AgentCircuitManager AuthenticateHandler |
296 | { | 304 | { |
@@ -349,13 +357,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
349 | get { return m_defaultScriptEngine; } | 357 | get { return m_defaultScriptEngine; } |
350 | } | 358 | } |
351 | 359 | ||
352 | // Reference to all of the agents in the scene (root and child) | ||
353 | protected Dictionary<UUID, ScenePresence> m_scenePresences | ||
354 | { | ||
355 | get { return m_sceneGraph.ScenePresences; } | ||
356 | set { m_sceneGraph.ScenePresences = value; } | ||
357 | } | ||
358 | |||
359 | public EntityManager Entities | 360 | public EntityManager Entities |
360 | { | 361 | { |
361 | get { return m_sceneGraph.Entities; } | 362 | get { return m_sceneGraph.Entities; } |
@@ -542,6 +543,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
542 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | 543 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; |
543 | break; | 544 | break; |
544 | } | 545 | } |
546 | |||
547 | m_reprioritization_enabled = interest_management_config.GetBoolean("ReprioritizationEnabled", true); | ||
548 | m_reprioritization_interval = interest_management_config.GetDouble("ReprioritizationInterval", 5000.0); | ||
549 | m_root_reprioritization_distance = interest_management_config.GetDouble("RootReprioritizationDistance", 10.0); | ||
550 | m_child_reprioritization_distance = interest_management_config.GetDouble("ChildReprioritizationDistance", 20.0); | ||
545 | } | 551 | } |
546 | 552 | ||
547 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); | 553 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); |
@@ -1170,14 +1176,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1170 | /// <param name="stats">Stats on the Simulator's performance</param> | 1176 | /// <param name="stats">Stats on the Simulator's performance</param> |
1171 | private void SendSimStatsPackets(SimStats stats) | 1177 | private void SendSimStatsPackets(SimStats stats) |
1172 | { | 1178 | { |
1173 | List<ScenePresence> StatSendAgents = GetScenePresences(); | 1179 | ForEachScenePresence( |
1174 | foreach (ScenePresence agent in StatSendAgents) | 1180 | delegate(ScenePresence agent) |
1175 | { | ||
1176 | if (!agent.IsChildAgent) | ||
1177 | { | 1181 | { |
1178 | agent.ControllingClient.SendSimStats(stats); | 1182 | if (!agent.IsChildAgent) |
1183 | agent.ControllingClient.SendSimStats(stats); | ||
1179 | } | 1184 | } |
1180 | } | 1185 | ); |
1181 | } | 1186 | } |
1182 | 1187 | ||
1183 | /// <summary> | 1188 | /// <summary> |
@@ -3488,10 +3493,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3488 | { | 3493 | { |
3489 | ScenePresence presence; | 3494 | ScenePresence presence; |
3490 | 3495 | ||
3491 | lock (m_scenePresences) | 3496 | lock (m_sceneGraph.ScenePresences) |
3492 | { | 3497 | m_sceneGraph.ScenePresences.TryGetValue(agentID, out presence); |
3493 | m_scenePresences.TryGetValue(agentID, out presence); | ||
3494 | } | ||
3495 | 3498 | ||
3496 | if (presence != null) | 3499 | if (presence != null) |
3497 | { | 3500 | { |
@@ -3701,12 +3704,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3701 | public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, | 3704 | public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, |
3702 | Vector3 lookAt, uint teleportFlags) | 3705 | Vector3 lookAt, uint teleportFlags) |
3703 | { | 3706 | { |
3704 | ScenePresence sp = null; | 3707 | ScenePresence sp; |
3705 | lock (m_scenePresences) | 3708 | lock (m_sceneGraph.ScenePresences) |
3706 | { | 3709 | m_sceneGraph.ScenePresences.TryGetValue(remoteClient.AgentId, out sp); |
3707 | if (m_scenePresences.ContainsKey(remoteClient.AgentId)) | ||
3708 | sp = m_scenePresences[remoteClient.AgentId]; | ||
3709 | } | ||
3710 | 3710 | ||
3711 | if (sp != null) | 3711 | if (sp != null) |
3712 | { | 3712 | { |
@@ -4155,7 +4155,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4155 | public void ForEachScenePresence(Action<ScenePresence> action) | 4155 | public void ForEachScenePresence(Action<ScenePresence> action) |
4156 | { | 4156 | { |
4157 | // We don't want to try to send messages if there are no avatars. | 4157 | // We don't want to try to send messages if there are no avatars. |
4158 | if (m_scenePresences != null) | 4158 | if (m_sceneGraph != null && m_sceneGraph.ScenePresences != null) |
4159 | { | 4159 | { |
4160 | try | 4160 | try |
4161 | { | 4161 | { |