diff options
author | Teravus Ovares | 2007-11-28 06:18:07 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-28 06:18:07 +0000 |
commit | b7d596a6af51bea7dba642cdc768ac5ff77af5f3 (patch) | |
tree | 967b749b10b548f6ed687d8ade4680e411793da4 /OpenSim/Region/Environment/Scenes/InnerScene.cs | |
parent | build ThrottleCheck function to clear up bits of the throttle (diff) | |
download | opensim-SC-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.zip opensim-SC-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.gz opensim-SC-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.bz2 opensim-SC-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.xz |
* Restaring the sim works fine in grid mode now. Sims announce themselves to their neighbors when they start up. Neighbors get this message and tell their agents that there's a new sim up.
* Certain unrecoverable physics based crashes in ODE are now hooked up to the 'restart the sim' routine.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 8f7cbee..c1acde4 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -11,8 +11,14 @@ using OpenSim.Region.Physics.Manager; | |||
11 | 11 | ||
12 | namespace OpenSim.Region.Environment.Scenes | 12 | namespace OpenSim.Region.Environment.Scenes |
13 | { | 13 | { |
14 | public delegate void PhysicsCrash(); | ||
15 | |||
14 | public class InnerScene | 16 | public class InnerScene |
15 | { | 17 | { |
18 | #region Events | ||
19 | public event PhysicsCrash UnRecoverableError; | ||
20 | #endregion | ||
21 | |||
16 | #region Fields | 22 | #region Fields |
17 | public Dictionary<LLUUID, ScenePresence> ScenePresences; | 23 | public Dictionary<LLUUID, ScenePresence> ScenePresences; |
18 | public Dictionary<LLUUID, SceneObjectGroup> SceneObjects; | 24 | public Dictionary<LLUUID, SceneObjectGroup> SceneObjects; |
@@ -26,17 +32,47 @@ namespace OpenSim.Region.Environment.Scenes | |||
26 | 32 | ||
27 | internal object m_syncRoot = new object(); | 33 | internal object m_syncRoot = new object(); |
28 | 34 | ||
29 | public PhysicsScene PhyScene; | 35 | public PhysicsScene _PhyScene; |
30 | #endregion | 36 | #endregion |
31 | 37 | ||
32 | public InnerScene(Scene parent, RegionInfo regInfo, PermissionManager permissionsMngr) | 38 | public InnerScene(Scene parent, RegionInfo regInfo, PermissionManager permissionsMngr) |
33 | { | 39 | { |
40 | |||
34 | m_parentScene = parent; | 41 | m_parentScene = parent; |
35 | m_regInfo = regInfo; | 42 | m_regInfo = regInfo; |
36 | PermissionsMngr = permissionsMngr; | 43 | PermissionsMngr = permissionsMngr; |
37 | QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, 256, 256); | 44 | QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, 256, 256); |
38 | QuadTree.Subdivide(); | 45 | QuadTree.Subdivide(); |
39 | QuadTree.Subdivide(); | 46 | QuadTree.Subdivide(); |
47 | |||
48 | |||
49 | } | ||
50 | public PhysicsScene PhyScene | ||
51 | { | ||
52 | get | ||
53 | { return _PhyScene; } | ||
54 | set | ||
55 | { | ||
56 | // If we're not doing the initial set | ||
57 | // Then we've got to remove the previous | ||
58 | // event handler | ||
59 | try | ||
60 | { | ||
61 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; | ||
62 | } | ||
63 | catch (System.NullReferenceException) | ||
64 | { | ||
65 | // This occurs when storing to _PhyScene the first time. | ||
66 | // Is there a better way to check the event handler before | ||
67 | // getting here | ||
68 | // This can be safely ignored. We're setting the first inital | ||
69 | // there are no event handler's registered. | ||
70 | } | ||
71 | |||
72 | _PhyScene = value; | ||
73 | |||
74 | _PhyScene.OnPhysicsCrash += physicsBasedCrash; | ||
75 | } | ||
40 | } | 76 | } |
41 | 77 | ||
42 | public void Close() | 78 | public void Close() |
@@ -55,9 +91,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
55 | 91 | ||
56 | // PhysX does this (runs in the background). | 92 | // PhysX does this (runs in the background). |
57 | 93 | ||
58 | if (PhyScene.IsThreaded) | 94 | if (_PhyScene.IsThreaded) |
59 | { | 95 | { |
60 | PhyScene.GetResults(); | 96 | _PhyScene.GetResults(); |
61 | } | 97 | } |
62 | } | 98 | } |
63 | 99 | ||
@@ -75,7 +111,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
75 | { | 111 | { |
76 | lock (m_syncRoot) | 112 | lock (m_syncRoot) |
77 | { | 113 | { |
78 | PhyScene.Simulate((float)elapsed); | 114 | _PhyScene.Simulate((float)elapsed); |
79 | } | 115 | } |
80 | } | 116 | } |
81 | 117 | ||
@@ -338,6 +374,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | 374 | ||
339 | #region Other Methods | 375 | #region Other Methods |
340 | 376 | ||
377 | |||
378 | public void physicsBasedCrash() | ||
379 | { | ||
380 | if (UnRecoverableError != null) | ||
381 | { | ||
382 | UnRecoverableError(); | ||
383 | } | ||
384 | } | ||
385 | |||
341 | public LLUUID ConvertLocalIDToFullID(uint localID) | 386 | public LLUUID ConvertLocalIDToFullID(uint localID) |
342 | { | 387 | { |
343 | SceneObjectGroup group = GetGroupByPrim(localID); | 388 | SceneObjectGroup group = GetGroupByPrim(localID); |