diff options
Diffstat (limited to '')
-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 d3d397d..0d8c241 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 | ||
@@ -268,9 +274,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
268 | private volatile bool shuttingdown = false; | 274 | private volatile bool shuttingdown = false; |
269 | 275 | ||
270 | private int m_lastUpdate = Environment.TickCount; | 276 | private int m_lastUpdate = Environment.TickCount; |
271 | private int m_maxPrimsPerFrame = 200; | ||
272 | private bool m_firstHeartbeat = true; | 277 | private bool m_firstHeartbeat = true; |
273 | 278 | ||
279 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
280 | |||
274 | private object m_deleting_scene_object = new object(); | 281 | private object m_deleting_scene_object = new object(); |
275 | 282 | ||
276 | // the minimum time that must elapse before a changed object will be considered for persisted | 283 | // the minimum time that must elapse before a changed object will be considered for persisted |
@@ -282,6 +289,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
282 | 289 | ||
283 | #region Properties | 290 | #region Properties |
284 | 291 | ||
292 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return this.m_update_prioritization_scheme; } } | ||
293 | |||
285 | public AgentCircuitManager AuthenticateHandler | 294 | public AgentCircuitManager AuthenticateHandler |
286 | { | 295 | { |
287 | get { return m_authenticateHandler; } | 296 | get { return m_authenticateHandler; } |
@@ -326,12 +335,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
326 | get { return m_sceneGraph.m_syncRoot; } | 335 | get { return m_sceneGraph.m_syncRoot; } |
327 | } | 336 | } |
328 | 337 | ||
329 | public int MaxPrimsPerFrame | ||
330 | { | ||
331 | get { return m_maxPrimsPerFrame; } | ||
332 | set { m_maxPrimsPerFrame = value; } | ||
333 | } | ||
334 | |||
335 | /// <summary> | 338 | /// <summary> |
336 | /// This is for llGetRegionFPS | 339 | /// This is for llGetRegionFPS |
337 | /// </summary> | 340 | /// </summary> |
@@ -509,7 +512,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
509 | 512 | ||
510 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); | 513 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); |
511 | 514 | ||
512 | m_maxPrimsPerFrame = startupConfig.GetInt("MaxPrimsPerFrame", 200); | ||
513 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 515 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
514 | if (packetConfig != null) | 516 | if (packetConfig != null) |
515 | { | 517 | { |
@@ -518,6 +520,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
518 | } | 520 | } |
519 | 521 | ||
520 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 522 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
523 | |||
524 | IConfig interest_management_config = m_config.Configs["InterestManagement"]; | ||
525 | if (interest_management_config != null) | ||
526 | { | ||
527 | string update_prioritization_scheme = interest_management_config.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); | ||
528 | switch (update_prioritization_scheme) | ||
529 | { | ||
530 | case "time": | ||
531 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
532 | break; | ||
533 | case "distance": | ||
534 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Distance; | ||
535 | break; | ||
536 | case "simpleangulardistance": | ||
537 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.SimpleAngularDistance; | ||
538 | break; | ||
539 | default: | ||
540 | m_log.Warn("[SCENE]: UpdatePrioritizationScheme was not recognized, setting to default settomg of Time"); | ||
541 | m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | ||
542 | break; | ||
543 | } | ||
544 | } | ||
545 | |||
546 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); | ||
521 | } | 547 | } |
522 | catch | 548 | catch |
523 | { | 549 | { |
@@ -1194,15 +1220,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1194 | } | 1220 | } |
1195 | 1221 | ||
1196 | /// <summary> | 1222 | /// <summary> |
1197 | /// Perform delegate action on all clients subscribing to updates from this region. | ||
1198 | /// </summary> | ||
1199 | /// <returns></returns> | ||
1200 | public void Broadcast(Action<IClientAPI> whatToDo) | ||
1201 | { | ||
1202 | ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); | ||
1203 | } | ||
1204 | |||
1205 | /// <summary> | ||
1206 | /// Backup the scene. This acts as the main method of the backup thread. | 1223 | /// Backup the scene. This acts as the main method of the backup thread. |
1207 | /// </summary> | 1224 | /// </summary> |
1208 | /// <returns></returns> | 1225 | /// <returns></returns> |
@@ -3048,17 +3065,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3048 | } | 3065 | } |
3049 | 3066 | ||
3050 | m_eventManager.TriggerOnRemovePresence(agentID); | 3067 | m_eventManager.TriggerOnRemovePresence(agentID); |
3051 | Broadcast(delegate(IClientAPI client) | 3068 | ForEachClient( |
3052 | { | 3069 | delegate(IClientAPI client) |
3053 | try | 3070 | { |
3054 | { | 3071 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway |
3055 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); | 3072 | try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } |
3056 | } | 3073 | catch (NullReferenceException) { } |
3057 | catch (NullReferenceException) | 3074 | }); |
3058 | { | ||
3059 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. | ||
3060 | } | ||
3061 | }); | ||
3062 | 3075 | ||
3063 | ForEachScenePresence( | 3076 | ForEachScenePresence( |
3064 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | 3077 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
@@ -3143,7 +3156,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3143 | return; | 3156 | return; |
3144 | } | 3157 | } |
3145 | } | 3158 | } |
3146 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); | 3159 | ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); |
3147 | } | 3160 | } |
3148 | 3161 | ||
3149 | #endregion | 3162 | #endregion |
@@ -4211,7 +4224,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4211 | 4224 | ||
4212 | public void ForEachClient(Action<IClientAPI> action) | 4225 | public void ForEachClient(Action<IClientAPI> action) |
4213 | { | 4226 | { |
4214 | m_sceneGraph.ForEachClient(action); | 4227 | ClientManager.ForEach(action); |
4215 | } | 4228 | } |
4216 | 4229 | ||
4217 | public void ForEachSOG(Action<SceneObjectGroup> action) | 4230 | public void ForEachSOG(Action<SceneObjectGroup> action) |