aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs32
1 files changed, 13 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 0e0b6c3..c70342f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -100,7 +100,6 @@ namespace OpenSim.Region.Framework.Scenes
100 } 100 }
101 101
102 private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>(); 102 private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>();
103 private Scene m_currentScene = null;
104 103
105 public List<Scene> Scenes 104 public List<Scene> Scenes
106 { 105 {
@@ -313,35 +312,30 @@ namespace OpenSim.Region.Framework.Scenes
313 312
314 public void SendCommandToPluginModules(string[] cmdparams) 313 public void SendCommandToPluginModules(string[] cmdparams)
315 { 314 {
316 ForEachCurrentScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); 315 ForEachSelectedScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); });
317 } 316 }
318 317
319 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) 318 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
320 { 319 {
321 ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); 320 ForEachSelectedScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); });
322 } 321 }
323 322
324 private void ForEachCurrentScene(Action<Scene> func) 323 public void ForEachSelectedScene(Action<Scene> func)
325 { 324 {
326 if (CurrentScene == null) 325 if (CurrentScene == null)
327 { 326 ForEachScene(func);
328 List<Scene> sceneList = Scenes;
329 sceneList.ForEach(func);
330 }
331 else 327 else
332 {
333 func(CurrentScene); 328 func(CurrentScene);
334 }
335 } 329 }
336 330
337 public void RestartCurrentScene() 331 public void RestartCurrentScene()
338 { 332 {
339 ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); 333 ForEachSelectedScene(delegate(Scene scene) { scene.RestartNow(); });
340 } 334 }
341 335
342 public void BackupCurrentScene() 336 public void BackupCurrentScene()
343 { 337 {
344 ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); 338 ForEachSelectedScene(delegate(Scene scene) { scene.Backup(true); });
345 } 339 }
346 340
347 public bool TrySetCurrentScene(string regionName) 341 public bool TrySetCurrentScene(string regionName)
@@ -359,7 +353,7 @@ namespace OpenSim.Region.Framework.Scenes
359 353
360 if (m_localScenes.TryGetValue(regionName, out s)) 354 if (m_localScenes.TryGetValue(regionName, out s))
361 { 355 {
362 m_currentScene = s; 356 CurrentScene = s;
363 return true; 357 return true;
364 } 358 }
365 359
@@ -375,7 +369,7 @@ namespace OpenSim.Region.Framework.Scenes
375 369
376 if (m_localScenes.TryGetValue(regionID, out s)) 370 if (m_localScenes.TryGetValue(regionID, out s))
377 { 371 {
378 m_currentScene = s; 372 CurrentScene = s;
379 return true; 373 return true;
380 } 374 }
381 375
@@ -434,7 +428,7 @@ namespace OpenSim.Region.Framework.Scenes
434 /// <param name="name">Name of avatar to debug</param> 428 /// <param name="name">Name of avatar to debug</param>
435 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) 429 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
436 { 430 {
437 ForEachCurrentScene(scene => 431 ForEachSelectedScene(scene =>
438 scene.ForEachScenePresence(sp => 432 scene.ForEachScenePresence(sp =>
439 { 433 {
440 if (name == null || sp.Name == name) 434 if (name == null || sp.Name == name)
@@ -453,7 +447,7 @@ namespace OpenSim.Region.Framework.Scenes
453 { 447 {
454 List<ScenePresence> avatars = new List<ScenePresence>(); 448 List<ScenePresence> avatars = new List<ScenePresence>();
455 449
456 ForEachCurrentScene( 450 ForEachSelectedScene(
457 delegate(Scene scene) 451 delegate(Scene scene)
458 { 452 {
459 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) 453 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@@ -470,7 +464,7 @@ namespace OpenSim.Region.Framework.Scenes
470 { 464 {
471 List<ScenePresence> presences = new List<ScenePresence>(); 465 List<ScenePresence> presences = new List<ScenePresence>();
472 466
473 ForEachCurrentScene(delegate(Scene scene) 467 ForEachSelectedScene(delegate(Scene scene)
474 { 468 {
475 scene.ForEachScenePresence(delegate(ScenePresence sp) 469 scene.ForEachScenePresence(delegate(ScenePresence sp)
476 { 470 {
@@ -494,12 +488,12 @@ namespace OpenSim.Region.Framework.Scenes
494 488
495 public void ForceCurrentSceneClientUpdate() 489 public void ForceCurrentSceneClientUpdate()
496 { 490 {
497 ForEachCurrentScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); 491 ForEachSelectedScene(delegate(Scene scene) { scene.ForceClientUpdate(); });
498 } 492 }
499 493
500 public void HandleEditCommandOnCurrentScene(string[] cmdparams) 494 public void HandleEditCommandOnCurrentScene(string[] cmdparams)
501 { 495 {
502 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); 496 ForEachSelectedScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
503 } 497 }
504 498
505 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 499 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)