diff options
author | John Hurliman | 2010-09-11 23:41:48 -0700 |
---|---|---|
committer | John Hurliman | 2010-09-11 23:41:48 -0700 |
commit | 007912d6f4810192853c4aeee5f9834de748f2b2 (patch) | |
tree | b9168cd2d43458e2c1ed7c4c28b2e88f6ecc5cb9 /OpenSim | |
parent | Changed all string references of "IRegionDataStore" to "ISimulationDataStore" (diff) | |
download | opensim-SC_OLD-007912d6f4810192853c4aeee5f9834de748f2b2.zip opensim-SC_OLD-007912d6f4810192853c4aeee5f9834de748f2b2.tar.gz opensim-SC_OLD-007912d6f4810192853c4aeee5f9834de748f2b2.tar.bz2 opensim-SC_OLD-007912d6f4810192853c4aeee5f9834de748f2b2.tar.xz |
Shuffling fields and properties around in Scene to make Scene.cs more readable
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 262 |
1 files changed, 124 insertions, 138 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6fa78e0..46b84bb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -57,55 +57,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
57 | 57 | ||
58 | public partial class Scene : SceneBase | 58 | public partial class Scene : SceneBase |
59 | { | 59 | { |
60 | public delegate void SynchronizeSceneHandler(Scene scene); | ||
61 | public SynchronizeSceneHandler SynchronizeScene = null; | ||
62 | |||
63 | /* Used by the loadbalancer plugin on GForge */ | ||
64 | protected int m_splitRegionID = 0; | ||
65 | public int SplitRegionID | ||
66 | { | ||
67 | get { return m_splitRegionID; } | ||
68 | set { m_splitRegionID = value; } | ||
69 | } | ||
70 | |||
71 | private const long DEFAULT_MIN_TIME_FOR_PERSISTENCE = 60L; | 60 | private const long DEFAULT_MIN_TIME_FOR_PERSISTENCE = 60L; |
72 | private const long DEFAULT_MAX_TIME_FOR_PERSISTENCE = 600L; | 61 | private const long DEFAULT_MAX_TIME_FOR_PERSISTENCE = 600L; |
73 | 62 | ||
74 | #region Fields | 63 | public delegate void SynchronizeSceneHandler(Scene scene); |
75 | 64 | ||
76 | protected Timer m_restartWaitTimer = new Timer(); | 65 | #region Fields |
77 | 66 | ||
67 | public SynchronizeSceneHandler SynchronizeScene; | ||
78 | public SimStatsReporter StatsReporter; | 68 | public SimStatsReporter StatsReporter; |
79 | |||
80 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); | ||
81 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); | ||
82 | |||
83 | private volatile int m_bordersLocked = 0; | ||
84 | public bool BordersLocked | ||
85 | { | ||
86 | get { return m_bordersLocked == 1; } | ||
87 | set | ||
88 | { | ||
89 | if (value == true) | ||
90 | m_bordersLocked = 1; | ||
91 | else | ||
92 | m_bordersLocked = 0; | ||
93 | } | ||
94 | } | ||
95 | public List<Border> NorthBorders = new List<Border>(); | 69 | public List<Border> NorthBorders = new List<Border>(); |
96 | public List<Border> EastBorders = new List<Border>(); | 70 | public List<Border> EastBorders = new List<Border>(); |
97 | public List<Border> SouthBorders = new List<Border>(); | 71 | public List<Border> SouthBorders = new List<Border>(); |
98 | public List<Border> WestBorders = new List<Border>(); | 72 | public List<Border> WestBorders = new List<Border>(); |
99 | 73 | ||
100 | /// <value> | 74 | /// <summary>Are we applying physics to any of the prims in this scene?</summary> |
101 | /// The scene graph for this scene | ||
102 | /// </value> | ||
103 | /// TODO: Possibly stop other classes being able to manipulate this directly. | ||
104 | private SceneGraph m_sceneGraph; | ||
105 | |||
106 | /// <summary> | ||
107 | /// Are we applying physics to any of the prims in this scene? | ||
108 | /// </summary> | ||
109 | public bool m_physicalPrim; | 75 | public bool m_physicalPrim; |
110 | public float m_maxNonphys = 256; | 76 | public float m_maxNonphys = 256; |
111 | public float m_maxPhys = 10; | 77 | public float m_maxPhys = 10; |
@@ -119,24 +85,127 @@ namespace OpenSim.Region.Framework.Scenes | |||
119 | // root agents when ACL denies access to root agent | 85 | // root agents when ACL denies access to root agent |
120 | public bool m_strictAccessControl = true; | 86 | public bool m_strictAccessControl = true; |
121 | public int MaxUndoCount = 5; | 87 | public int MaxUndoCount = 5; |
88 | public bool LoginsDisabled = true; | ||
89 | public bool LoadingPrims; | ||
90 | public IXfer XferManager; | ||
91 | |||
92 | // the minimum time that must elapse before a changed object will be considered for persisted | ||
93 | public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; | ||
94 | // the maximum time that must elapse before a changed object will be considered for persisted | ||
95 | public long m_persistAfter = DEFAULT_MAX_TIME_FOR_PERSISTENCE * 10000000L; | ||
96 | |||
97 | protected int m_splitRegionID; | ||
98 | protected Timer m_restartWaitTimer = new Timer(); | ||
99 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); | ||
100 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); | ||
101 | protected string m_simulatorVersion = "OpenSimulator Server"; | ||
102 | protected ModuleLoader m_moduleLoader; | ||
103 | protected StorageManager m_storageManager; | ||
104 | protected AgentCircuitManager m_authenticateHandler; | ||
105 | protected SceneCommunicationService m_sceneGridService; | ||
106 | |||
107 | protected IAssetService m_AssetService; | ||
108 | protected IAuthorizationService m_AuthorizationService; | ||
109 | protected IInventoryService m_InventoryService; | ||
110 | protected IGridService m_GridService; | ||
111 | protected ILibraryService m_LibraryService; | ||
112 | protected ISimulationService m_simulationService; | ||
113 | protected IAuthenticationService m_AuthenticationService; | ||
114 | protected IPresenceService m_PresenceService; | ||
115 | protected IUserAccountService m_UserAccountService; | ||
116 | protected IAvatarService m_AvatarService; | ||
117 | protected IGridUserService m_GridUserService; | ||
118 | |||
119 | protected IXMLRPC m_xmlrpcModule; | ||
120 | protected IWorldComm m_worldCommModule; | ||
121 | protected IAvatarFactory m_AvatarFactory; | ||
122 | protected IConfigSource m_config; | ||
123 | protected IRegionSerialiserModule m_serialiser; | ||
124 | protected IDialogModule m_dialogModule; | ||
125 | protected IEntityTransferModule m_teleportModule; | ||
126 | protected ICapabilitiesModule m_capsModule; | ||
127 | // Central Update Loop | ||
128 | protected int m_fps = 10; | ||
129 | protected uint m_frame; | ||
130 | protected float m_timespan = 0.089f; | ||
131 | protected DateTime m_lastupdate = DateTime.UtcNow; | ||
132 | |||
133 | // TODO: Possibly stop other classes being able to manipulate this directly. | ||
134 | private SceneGraph m_sceneGraph; | ||
135 | private volatile int m_bordersLocked; | ||
122 | private int m_RestartTimerCounter; | 136 | private int m_RestartTimerCounter; |
123 | private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing | 137 | private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing |
124 | private int m_incrementsof15seconds; | 138 | private int m_incrementsof15seconds; |
125 | private volatile bool m_backingup; | 139 | private volatile bool m_backingup; |
126 | |||
127 | private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>(); | 140 | private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>(); |
128 | private Dictionary<UUID, SceneObjectGroup> m_groupsWithTargets = new Dictionary<UUID, SceneObjectGroup>(); | 141 | private Dictionary<UUID, SceneObjectGroup> m_groupsWithTargets = new Dictionary<UUID, SceneObjectGroup>(); |
142 | private Object m_heartbeatLock = new Object(); | ||
129 | 143 | ||
130 | protected string m_simulatorVersion = "OpenSimulator Server"; | 144 | private int m_update_physics = 1; |
145 | private int m_update_entitymovement = 1; | ||
146 | private int m_update_objects = 1; // Update objects which have scheduled themselves for updates | ||
147 | private int m_update_presences = 1; // Update scene presence movements | ||
148 | private int m_update_events = 1; | ||
149 | private int m_update_backup = 200; | ||
150 | private int m_update_terrain = 50; | ||
151 | private int m_update_land = 1; | ||
152 | private int m_update_coarse_locations = 50; | ||
131 | 153 | ||
132 | protected ModuleLoader m_moduleLoader; | 154 | private int frameMS; |
133 | protected StorageManager m_storageManager; | 155 | private int physicsMS2; |
134 | protected AgentCircuitManager m_authenticateHandler; | 156 | private int physicsMS; |
157 | private int otherMS; | ||
158 | private int tempOnRezMS; | ||
159 | private int eventMS; | ||
160 | private int backupMS; | ||
161 | private int terrainMS; | ||
162 | private int landMS; | ||
163 | private int lastCompletedFrame; | ||
135 | 164 | ||
136 | protected SceneCommunicationService m_sceneGridService; | 165 | private bool m_physics_enabled = true; |
137 | public bool LoginsDisabled = true; | 166 | private bool m_scripts_enabled = true; |
138 | public bool LoadingPrims = false; | 167 | private string m_defaultScriptEngine; |
168 | private int m_LastLogin; | ||
169 | private Thread HeartbeatThread; | ||
170 | private volatile bool shuttingdown; | ||
171 | |||
172 | private int m_lastUpdate; | ||
173 | private bool m_firstHeartbeat = true; | ||
139 | 174 | ||
175 | private object m_deleting_scene_object = new object(); | ||
176 | |||
177 | private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; | ||
178 | private bool m_reprioritizationEnabled = true; | ||
179 | private double m_reprioritizationInterval = 5000.0; | ||
180 | private double m_rootReprioritizationDistance = 10.0; | ||
181 | private double m_childReprioritizationDistance = 20.0; | ||
182 | |||
183 | private Timer m_mapGenerationTimer = new Timer(); | ||
184 | private bool m_generateMaptiles; | ||
185 | |||
186 | #endregion Fields | ||
187 | |||
188 | #region Properties | ||
189 | |||
190 | /* Used by the loadbalancer plugin on GForge */ | ||
191 | public int SplitRegionID | ||
192 | { | ||
193 | get { return m_splitRegionID; } | ||
194 | set { m_splitRegionID = value; } | ||
195 | } | ||
196 | |||
197 | public bool BordersLocked | ||
198 | { | ||
199 | get { return m_bordersLocked == 1; } | ||
200 | set | ||
201 | { | ||
202 | if (value == true) | ||
203 | m_bordersLocked = 1; | ||
204 | else | ||
205 | m_bordersLocked = 0; | ||
206 | } | ||
207 | } | ||
208 | |||
140 | public new float TimeDilation | 209 | public new float TimeDilation |
141 | { | 210 | { |
142 | get { return m_sceneGraph.PhysicsScene.TimeDilation; } | 211 | get { return m_sceneGraph.PhysicsScene.TimeDilation; } |
@@ -147,13 +216,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
147 | get { return m_sceneGridService; } | 216 | get { return m_sceneGridService; } |
148 | } | 217 | } |
149 | 218 | ||
150 | public IXfer XferManager; | ||
151 | |||
152 | protected IAssetService m_AssetService; | ||
153 | protected IAuthorizationService m_AuthorizationService; | ||
154 | |||
155 | private Object m_heartbeatLock = new Object(); | ||
156 | |||
157 | public IAssetService AssetService | 219 | public IAssetService AssetService |
158 | { | 220 | { |
159 | get | 221 | get |
@@ -191,8 +253,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
191 | } | 253 | } |
192 | } | 254 | } |
193 | 255 | ||
194 | protected IInventoryService m_InventoryService; | ||
195 | |||
196 | public IInventoryService InventoryService | 256 | public IInventoryService InventoryService |
197 | { | 257 | { |
198 | get | 258 | get |
@@ -211,8 +271,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
211 | } | 271 | } |
212 | } | 272 | } |
213 | 273 | ||
214 | protected IGridService m_GridService; | ||
215 | |||
216 | public IGridService GridService | 274 | public IGridService GridService |
217 | { | 275 | { |
218 | get | 276 | get |
@@ -231,8 +289,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
231 | } | 289 | } |
232 | } | 290 | } |
233 | 291 | ||
234 | protected ILibraryService m_LibraryService; | ||
235 | |||
236 | public ILibraryService LibraryService | 292 | public ILibraryService LibraryService |
237 | { | 293 | { |
238 | get | 294 | get |
@@ -244,7 +300,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
244 | } | 300 | } |
245 | } | 301 | } |
246 | 302 | ||
247 | protected ISimulationService m_simulationService; | ||
248 | public ISimulationService SimulationService | 303 | public ISimulationService SimulationService |
249 | { | 304 | { |
250 | get | 305 | get |
@@ -255,7 +310,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
255 | } | 310 | } |
256 | } | 311 | } |
257 | 312 | ||
258 | protected IAuthenticationService m_AuthenticationService; | ||
259 | public IAuthenticationService AuthenticationService | 313 | public IAuthenticationService AuthenticationService |
260 | { | 314 | { |
261 | get | 315 | get |
@@ -266,7 +320,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
266 | } | 320 | } |
267 | } | 321 | } |
268 | 322 | ||
269 | protected IPresenceService m_PresenceService; | ||
270 | public IPresenceService PresenceService | 323 | public IPresenceService PresenceService |
271 | { | 324 | { |
272 | get | 325 | get |
@@ -276,7 +329,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
276 | return m_PresenceService; | 329 | return m_PresenceService; |
277 | } | 330 | } |
278 | } | 331 | } |
279 | protected IUserAccountService m_UserAccountService; | 332 | |
280 | public IUserAccountService UserAccountService | 333 | public IUserAccountService UserAccountService |
281 | { | 334 | { |
282 | get | 335 | get |
@@ -287,8 +340,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
287 | } | 340 | } |
288 | } | 341 | } |
289 | 342 | ||
290 | protected OpenSim.Services.Interfaces.IAvatarService m_AvatarService; | 343 | public IAvatarService AvatarService |
291 | public OpenSim.Services.Interfaces.IAvatarService AvatarService | ||
292 | { | 344 | { |
293 | get | 345 | get |
294 | { | 346 | { |
@@ -298,7 +350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
298 | } | 350 | } |
299 | } | 351 | } |
300 | 352 | ||
301 | protected IGridUserService m_GridUserService; | ||
302 | public IGridUserService GridUserService | 353 | public IGridUserService GridUserService |
303 | { | 354 | { |
304 | get | 355 | get |
@@ -309,58 +360,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
309 | } | 360 | } |
310 | } | 361 | } |
311 | 362 | ||
312 | protected IXMLRPC m_xmlrpcModule; | ||
313 | protected IWorldComm m_worldCommModule; | ||
314 | public IAttachmentsModule AttachmentsModule { get; set; } | 363 | public IAttachmentsModule AttachmentsModule { get; set; } |
315 | protected IAvatarFactory m_AvatarFactory; | 364 | |
316 | public IAvatarFactory AvatarFactory | 365 | public IAvatarFactory AvatarFactory |
317 | { | 366 | { |
318 | get { return m_AvatarFactory; } | 367 | get { return m_AvatarFactory; } |
319 | } | 368 | } |
320 | protected IConfigSource m_config; | ||
321 | protected IRegionSerialiserModule m_serialiser; | ||
322 | protected IDialogModule m_dialogModule; | ||
323 | protected IEntityTransferModule m_teleportModule; | ||
324 | 369 | ||
325 | protected ICapabilitiesModule m_capsModule; | ||
326 | public ICapabilitiesModule CapsModule | 370 | public ICapabilitiesModule CapsModule |
327 | { | 371 | { |
328 | get { return m_capsModule; } | 372 | get { return m_capsModule; } |
329 | } | 373 | } |
330 | 374 | ||
331 | protected override IConfigSource GetConfig() | ||
332 | { | ||
333 | return m_config; | ||
334 | } | ||
335 | |||
336 | // Central Update Loop | ||
337 | |||
338 | protected int m_fps = 10; | ||
339 | protected uint m_frame; | ||
340 | protected float m_timespan = 0.089f; | ||
341 | protected DateTime m_lastupdate = DateTime.UtcNow; | ||
342 | |||
343 | private int m_update_physics = 1; | ||
344 | private int m_update_entitymovement = 1; | ||
345 | private int m_update_objects = 1; // Update objects which have scheduled themselves for updates | ||
346 | private int m_update_presences = 1; // Update scene presence movements | ||
347 | private int m_update_events = 1; | ||
348 | private int m_update_backup = 200; | ||
349 | private int m_update_terrain = 50; | ||
350 | private int m_update_land = 1; | ||
351 | private int m_update_coarse_locations = 50; | ||
352 | |||
353 | private int frameMS; | ||
354 | private int physicsMS2; | ||
355 | private int physicsMS; | ||
356 | private int otherMS; | ||
357 | private int tempOnRezMS; | ||
358 | private int eventMS; | ||
359 | private int backupMS; | ||
360 | private int terrainMS; | ||
361 | private int landMS; | ||
362 | private int lastCompletedFrame; | ||
363 | |||
364 | public int MonitorFrameTime { get { return frameMS; } } | 375 | public int MonitorFrameTime { get { return frameMS; } } |
365 | public int MonitorPhysicsUpdateTime { get { return physicsMS; } } | 376 | public int MonitorPhysicsUpdateTime { get { return physicsMS; } } |
366 | public int MonitorPhysicsSyncTime { get { return physicsMS2; } } | 377 | public int MonitorPhysicsSyncTime { get { return physicsMS2; } } |
@@ -372,36 +383,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
372 | public int MonitorLandTime { get { return landMS; } } | 383 | public int MonitorLandTime { get { return landMS; } } |
373 | public int MonitorLastFrameTick { get { return lastCompletedFrame; } } | 384 | public int MonitorLastFrameTick { get { return lastCompletedFrame; } } |
374 | 385 | ||
375 | private bool m_physics_enabled = true; | ||
376 | private bool m_scripts_enabled = true; | ||
377 | private string m_defaultScriptEngine; | ||
378 | private int m_LastLogin; | ||
379 | private Thread HeartbeatThread; | ||
380 | private volatile bool shuttingdown; | ||
381 | |||
382 | private int m_lastUpdate; | ||
383 | private bool m_firstHeartbeat = true; | ||
384 | |||
385 | private object m_deleting_scene_object = new object(); | ||
386 | |||
387 | // the minimum time that must elapse before a changed object will be considered for persisted | ||
388 | public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; | ||
389 | // the maximum time that must elapse before a changed object will be considered for persisted | ||
390 | public long m_persistAfter = DEFAULT_MAX_TIME_FOR_PERSISTENCE * 10000000L; | ||
391 | |||
392 | private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; | ||
393 | private bool m_reprioritizationEnabled = true; | ||
394 | private double m_reprioritizationInterval = 5000.0; | ||
395 | private double m_rootReprioritizationDistance = 10.0; | ||
396 | private double m_childReprioritizationDistance = 20.0; | ||
397 | |||
398 | private Timer m_mapGenerationTimer = new Timer(); | ||
399 | bool m_generateMaptiles = false; | ||
400 | |||
401 | #endregion | ||
402 | |||
403 | #region Properties | ||
404 | |||
405 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } | 386 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } |
406 | public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } | 387 | public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } |
407 | public double ReprioritizationInterval { get { return m_reprioritizationInterval; } } | 388 | public double ReprioritizationInterval { get { return m_reprioritizationInterval; } } |
@@ -481,7 +462,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
481 | set { m_sceneGraph.RestorePresences = value; } | 462 | set { m_sceneGraph.RestorePresences = value; } |
482 | } | 463 | } |
483 | 464 | ||
484 | #endregion | 465 | #endregion Properties |
485 | 466 | ||
486 | #region Constructors | 467 | #region Constructors |
487 | 468 | ||
@@ -3954,6 +3935,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3954 | 3935 | ||
3955 | #region Other Methods | 3936 | #region Other Methods |
3956 | 3937 | ||
3938 | protected override IConfigSource GetConfig() | ||
3939 | { | ||
3940 | return m_config; | ||
3941 | } | ||
3942 | |||
3957 | #endregion | 3943 | #endregion |
3958 | 3944 | ||
3959 | public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) | 3945 | public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) |