aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs32
1 files changed, 21 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index ff12d94..0e0b6c3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -107,16 +107,19 @@ namespace OpenSim.Region.Framework.Scenes
107 get { return new List<Scene>(m_localScenes.FindAll(delegate(Scene s) { return true; })); } 107 get { return new List<Scene>(m_localScenes.FindAll(delegate(Scene s) { return true; })); }
108 } 108 }
109 109
110 public Scene CurrentScene 110 /// <summary>
111 { 111 /// Scene selected from the console.
112 get { return m_currentScene; } 112 /// </summary>
113 } 113 /// <value>
114 /// If null, then all scenes are considered selected (signalled as "Root" on the console).
115 /// </value>
116 public Scene CurrentScene { get; private set; }
114 117
115 public Scene CurrentOrFirstScene 118 public Scene CurrentOrFirstScene
116 { 119 {
117 get 120 get
118 { 121 {
119 if (m_currentScene == null) 122 if (CurrentScene == null)
120 { 123 {
121 List<Scene> sceneList = Scenes; 124 List<Scene> sceneList = Scenes;
122 if (sceneList.Count == 0) 125 if (sceneList.Count == 0)
@@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes
125 } 128 }
126 else 129 else
127 { 130 {
128 return m_currentScene; 131 return CurrentScene;
129 } 132 }
130 } 133 }
131 } 134 }
@@ -169,11 +172,18 @@ namespace OpenSim.Region.Framework.Scenes
169 172
170 public void HandleRestart(RegionInfo rdata) 173 public void HandleRestart(RegionInfo rdata)
171 { 174 {
172 m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); 175 Scene restartedScene = null;
173 int RegionSceneElement = -1;
174 176
175 lock (m_localScenes) 177 lock (m_localScenes)
178 {
179 m_localScenes.TryGetValue(rdata.RegionID, out restartedScene);
176 m_localScenes.Remove(rdata.RegionID); 180 m_localScenes.Remove(rdata.RegionID);
181 }
182
183 // If the currently selected scene has been restarted, then we can't reselect here since we the scene
184 // hasn't yet been recreated. We will have to leave this to the caller.
185 if (CurrentScene == restartedScene)
186 CurrentScene = null;
177 187
178 // Send signal to main that we're restarting this sim. 188 // Send signal to main that we're restarting this sim.
179 OnRestartSim(rdata); 189 OnRestartSim(rdata);
@@ -313,14 +323,14 @@ namespace OpenSim.Region.Framework.Scenes
313 323
314 private void ForEachCurrentScene(Action<Scene> func) 324 private void ForEachCurrentScene(Action<Scene> func)
315 { 325 {
316 if (m_currentScene == null) 326 if (CurrentScene == null)
317 { 327 {
318 List<Scene> sceneList = Scenes; 328 List<Scene> sceneList = Scenes;
319 sceneList.ForEach(func); 329 sceneList.ForEach(func);
320 } 330 }
321 else 331 else
322 { 332 {
323 func(m_currentScene); 333 func(CurrentScene);
324 } 334 }
325 } 335 }
326 336
@@ -340,7 +350,7 @@ namespace OpenSim.Region.Framework.Scenes
340 || (String.Compare(regionName, "..") == 0) 350 || (String.Compare(regionName, "..") == 0)
341 || (String.Compare(regionName, "/") == 0)) 351 || (String.Compare(regionName, "/") == 0))
342 { 352 {
343 m_currentScene = null; 353 CurrentScene = null;
344 return true; 354 return true;
345 } 355 }
346 else 356 else