diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 46 |
2 files changed, 25 insertions, 31 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index db45d6b..8ef22bd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1134,15 +1134,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1134 | } | 1134 | } |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | m_log.Error("[REGION]: Closing"); | 1137 | m_log.InfoFormat("[REGION]: Restarting region {0}", Name); |
1138 | Close(); | ||
1139 | 1138 | ||
1140 | if (PhysicsScene != null) | 1139 | Close(); |
1141 | { | ||
1142 | PhysicsScene.Dispose(); | ||
1143 | } | ||
1144 | |||
1145 | m_log.Error("[REGION]: Firing Region Restart Message"); | ||
1146 | 1140 | ||
1147 | base.Restart(); | 1141 | base.Restart(); |
1148 | } | 1142 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 1c236db..1e2e973 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -100,23 +100,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
100 | } | 100 | } |
101 | 101 | ||
102 | private readonly List<Scene> m_localScenes = new List<Scene>(); | 102 | private readonly List<Scene> m_localScenes = new List<Scene>(); |
103 | private Scene m_currentScene = null; | ||
104 | 103 | ||
105 | public List<Scene> Scenes | 104 | public List<Scene> Scenes |
106 | { | 105 | { |
107 | get { return new List<Scene>(m_localScenes); } | 106 | get { return new List<Scene>(m_localScenes); } |
108 | } | 107 | } |
109 | 108 | ||
110 | public Scene CurrentScene | 109 | /// <summary> |
111 | { | 110 | /// Scene selected from the console. |
112 | get { return m_currentScene; } | 111 | /// </summary> |
113 | } | 112 | /// <value> |
113 | /// If null, then all scenes are considered selected (signalled as "Root" on the console). | ||
114 | /// </value> | ||
115 | public Scene CurrentScene { get; private set; } | ||
114 | 116 | ||
115 | public Scene CurrentOrFirstScene | 117 | public Scene CurrentOrFirstScene |
116 | { | 118 | { |
117 | get | 119 | get |
118 | { | 120 | { |
119 | if (m_currentScene == null) | 121 | if (CurrentScene == null) |
120 | { | 122 | { |
121 | lock (m_localScenes) | 123 | lock (m_localScenes) |
122 | { | 124 | { |
@@ -128,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
128 | } | 130 | } |
129 | else | 131 | else |
130 | { | 132 | { |
131 | return m_currentScene; | 133 | return CurrentScene; |
132 | } | 134 | } |
133 | } | 135 | } |
134 | } | 136 | } |
@@ -178,8 +180,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | 180 | ||
179 | public void HandleRestart(RegionInfo rdata) | 181 | public void HandleRestart(RegionInfo rdata) |
180 | { | 182 | { |
181 | m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); | 183 | Scene restartedScene = null; |
182 | int RegionSceneElement = -1; | ||
183 | 184 | ||
184 | lock (m_localScenes) | 185 | lock (m_localScenes) |
185 | { | 186 | { |
@@ -187,19 +188,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
187 | { | 188 | { |
188 | if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) | 189 | if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) |
189 | { | 190 | { |
190 | RegionSceneElement = i; | 191 | restartedScene = m_localScenes[i]; |
192 | m_localScenes.RemoveAt(i); | ||
193 | break; | ||
191 | } | 194 | } |
192 | } | 195 | } |
193 | |||
194 | // Now we make sure the region is no longer known about by the SceneManager | ||
195 | // Prevents duplicates. | ||
196 | |||
197 | if (RegionSceneElement >= 0) | ||
198 | { | ||
199 | m_localScenes.RemoveAt(RegionSceneElement); | ||
200 | } | ||
201 | } | 196 | } |
202 | 197 | ||
198 | // If the currently selected scene has been restarted, then we can't reselect here since we the scene | ||
199 | // hasn't yet been recreated. We will have to leave this to the caller. | ||
200 | if (CurrentScene == restartedScene) | ||
201 | CurrentScene = null; | ||
202 | |||
203 | // Send signal to main that we're restarting this sim. | 203 | // Send signal to main that we're restarting this sim. |
204 | OnRestartSim(rdata); | 204 | OnRestartSim(rdata); |
205 | } | 205 | } |
@@ -341,14 +341,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
341 | 341 | ||
342 | private void ForEachCurrentScene(Action<Scene> func) | 342 | private void ForEachCurrentScene(Action<Scene> func) |
343 | { | 343 | { |
344 | if (m_currentScene == null) | 344 | if (CurrentScene == null) |
345 | { | 345 | { |
346 | lock (m_localScenes) | 346 | lock (m_localScenes) |
347 | m_localScenes.ForEach(func); | 347 | m_localScenes.ForEach(func); |
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | func(m_currentScene); | 351 | func(CurrentScene); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
@@ -368,7 +368,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
368 | || (String.Compare(regionName, "..") == 0) | 368 | || (String.Compare(regionName, "..") == 0) |
369 | || (String.Compare(regionName, "/") == 0)) | 369 | || (String.Compare(regionName, "/") == 0)) |
370 | { | 370 | { |
371 | m_currentScene = null; | 371 | CurrentScene = null; |
372 | return true; | 372 | return true; |
373 | } | 373 | } |
374 | else | 374 | else |
@@ -379,7 +379,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
379 | { | 379 | { |
380 | if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0) | 380 | if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0) |
381 | { | 381 | { |
382 | m_currentScene = scene; | 382 | CurrentScene = scene; |
383 | return true; | 383 | return true; |
384 | } | 384 | } |
385 | } | 385 | } |
@@ -399,7 +399,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
399 | { | 399 | { |
400 | if (scene.RegionInfo.RegionID == regionID) | 400 | if (scene.RegionInfo.RegionID == regionID) |
401 | { | 401 | { |
402 | m_currentScene = scene; | 402 | CurrentScene = scene; |
403 | return true; | 403 | return true; |
404 | } | 404 | } |
405 | } | 405 | } |