diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 73 |
1 files changed, 43 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 29d2a84..49c1ebf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -57,6 +57,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
57 | 57 | ||
58 | public partial class Scene : SceneBase | 58 | public partial class Scene : SceneBase |
59 | { | 59 | { |
60 | public enum UpdatePrioritizationSchemes { | ||
61 | Time = 0, | ||
62 | Distance = 1, | ||
63 | SimpleAngularDistance = 2, | ||
64 | } | ||
65 | |||
60 | public delegate void SynchronizeSceneHandler(Scene scene); | 66 | public delegate void SynchronizeSceneHandler(Scene scene); |
61 | public SynchronizeSceneHandler SynchronizeScene = null; | 67 | public SynchronizeSceneHandler SynchronizeScene = null; |
62 | 68 | ||
@@ -269,9 +275,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
269 | private volatile bool shuttingdown = false; | 275 | private volatile bool shuttingdown = false; |
270 | 276 | ||
271 | private int m_lastUpdate = Environment.TickCount; | 277 | private int m_lastUpdate = Environment.TickCount; |
272 | private int m_maxPrimsPerFrame = 200; | ||
273 | private bool m_firstHeartbeat = true; | 278 | private bool m_firstHeartbeat = true; |
274 | 279 | ||
280 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
281 | |||
275 | private object m_deleting_scene_object = new object(); | 282 | private object m_deleting_scene_object = new object(); |
276 | 283 | ||
277 | // the minimum time that must elapse before a changed object will be considered for persisted | 284 | // the minimum time that must elapse before a changed object will be considered for persisted |
@@ -283,6 +290,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
283 | 290 | ||
284 | #region Properties | 291 | #region Properties |
285 | 292 | ||
293 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return this.m_update_prioritization_scheme; } } | ||
294 | |||
286 | public AgentCircuitManager AuthenticateHandler | 295 | public AgentCircuitManager AuthenticateHandler |
287 | { | 296 | { |
288 | get { return m_authenticateHandler; } | 297 | get { return m_authenticateHandler; } |
@@ -327,12 +336,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
327 | get { return m_sceneGraph.m_syncRoot; } | 336 | get { return m_sceneGraph.m_syncRoot; } |
328 | } | 337 | } |
329 | 338 | ||
330 | public int MaxPrimsPerFrame | ||
331 | { | ||
332 | get { return m_maxPrimsPerFrame; } | ||
333 | set { m_maxPrimsPerFrame = value; } | ||
334 | } | ||
335 | |||
336 | /// <summary> | 339 | /// <summary> |
337 | /// This is for llGetRegionFPS | 340 | /// This is for llGetRegionFPS |
338 | /// </summary> | 341 | /// </summary> |
@@ -510,7 +513,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
510 | 513 | ||
511 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); | 514 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); |
512 | 515 | ||
513 | m_maxPrimsPerFrame = startupConfig.GetInt("MaxPrimsPerFrame", 200); | ||
514 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 516 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
515 | if (packetConfig != null) | 517 | if (packetConfig != null) |
516 | { | 518 | { |
@@ -519,6 +521,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
519 | } | 521 | } |
520 | 522 | ||
521 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 523 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
524 | |||
525 | IConfig interest_management_config = m_config.Configs["InterestManagement"]; | ||
526 | if (interest_management_config != null) | ||
527 | { | ||
528 | string update_prioritization_scheme = interest_management_config.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); | ||
529 | switch (update_prioritization_scheme) | ||
530 | { | ||
531 | case "time": | ||
532 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
533 | break; | ||
534 | case "distance": | ||
535 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Distance; | ||
536 | break; | ||
537 | case "simpleangulardistance": | ||
538 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.SimpleAngularDistance; | ||
539 | break; | ||
540 | default: | ||
541 | m_log.Warn("[SCENE]: UpdatePrioritizationScheme was not recognized, setting to default settomg of Time"); | ||
542 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
543 | break; | ||
544 | } | ||
545 | } | ||
546 | |||
547 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); | ||
522 | } | 548 | } |
523 | catch | 549 | catch |
524 | { | 550 | { |
@@ -1200,15 +1226,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1200 | } | 1226 | } |
1201 | 1227 | ||
1202 | /// <summary> | 1228 | /// <summary> |
1203 | /// Perform delegate action on all clients subscribing to updates from this region. | ||
1204 | /// </summary> | ||
1205 | /// <returns></returns> | ||
1206 | public void Broadcast(Action<IClientAPI> whatToDo) | ||
1207 | { | ||
1208 | ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); | ||
1209 | } | ||
1210 | |||
1211 | /// <summary> | ||
1212 | /// Backup the scene. This acts as the main method of the backup thread. | 1229 | /// Backup the scene. This acts as the main method of the backup thread. |
1213 | /// </summary> | 1230 | /// </summary> |
1214 | /// <returns></returns> | 1231 | /// <returns></returns> |
@@ -3054,17 +3071,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3054 | } | 3071 | } |
3055 | 3072 | ||
3056 | m_eventManager.TriggerOnRemovePresence(agentID); | 3073 | m_eventManager.TriggerOnRemovePresence(agentID); |
3057 | Broadcast(delegate(IClientAPI client) | 3074 | ForEachClient( |
3058 | { | 3075 | delegate(IClientAPI client) |
3059 | try | 3076 | { |
3060 | { | 3077 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway |
3061 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); | 3078 | try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } |
3062 | } | 3079 | catch (NullReferenceException) { } |
3063 | catch (NullReferenceException) | 3080 | }); |
3064 | { | ||
3065 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. | ||
3066 | } | ||
3067 | }); | ||
3068 | 3081 | ||
3069 | ForEachScenePresence( | 3082 | ForEachScenePresence( |
3070 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | 3083 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
@@ -3149,7 +3162,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3149 | return; | 3162 | return; |
3150 | } | 3163 | } |
3151 | } | 3164 | } |
3152 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); | 3165 | ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); |
3153 | } | 3166 | } |
3154 | 3167 | ||
3155 | #endregion | 3168 | #endregion |
@@ -4222,7 +4235,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4222 | 4235 | ||
4223 | public void ForEachClient(Action<IClientAPI> action) | 4236 | public void ForEachClient(Action<IClientAPI> action) |
4224 | { | 4237 | { |
4225 | m_sceneGraph.ForEachClient(action); | 4238 | ClientManager.ForEach(action); |
4226 | } | 4239 | } |
4227 | 4240 | ||
4228 | public void ForEachSOG(Action<SceneObjectGroup> action) | 4241 | public void ForEachSOG(Action<SceneObjectGroup> action) |