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.cs27
1 files changed, 11 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 0e0b6c3..c307f7a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -313,35 +313,30 @@ namespace OpenSim.Region.Framework.Scenes
313 313
314 public void SendCommandToPluginModules(string[] cmdparams) 314 public void SendCommandToPluginModules(string[] cmdparams)
315 { 315 {
316 ForEachCurrentScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); 316 ForEachSelectedScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); });
317 } 317 }
318 318
319 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) 319 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
320 { 320 {
321 ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); 321 ForEachSelectedScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); });
322 } 322 }
323 323
324 private void ForEachCurrentScene(Action<Scene> func) 324 public void ForEachSelectedScene(Action<Scene> func)
325 { 325 {
326 if (CurrentScene == null) 326 if (CurrentScene == null)
327 { 327 ForEachScene(func);
328 List<Scene> sceneList = Scenes;
329 sceneList.ForEach(func);
330 }
331 else 328 else
332 {
333 func(CurrentScene); 329 func(CurrentScene);
334 }
335 } 330 }
336 331
337 public void RestartCurrentScene() 332 public void RestartCurrentScene()
338 { 333 {
339 ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); 334 ForEachSelectedScene(delegate(Scene scene) { scene.RestartNow(); });
340 } 335 }
341 336
342 public void BackupCurrentScene() 337 public void BackupCurrentScene()
343 { 338 {
344 ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); 339 ForEachSelectedScene(delegate(Scene scene) { scene.Backup(true); });
345 } 340 }
346 341
347 public bool TrySetCurrentScene(string regionName) 342 public bool TrySetCurrentScene(string regionName)
@@ -434,7 +429,7 @@ namespace OpenSim.Region.Framework.Scenes
434 /// <param name="name">Name of avatar to debug</param> 429 /// <param name="name">Name of avatar to debug</param>
435 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) 430 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
436 { 431 {
437 ForEachCurrentScene(scene => 432 ForEachSelectedScene(scene =>
438 scene.ForEachScenePresence(sp => 433 scene.ForEachScenePresence(sp =>
439 { 434 {
440 if (name == null || sp.Name == name) 435 if (name == null || sp.Name == name)
@@ -453,7 +448,7 @@ namespace OpenSim.Region.Framework.Scenes
453 { 448 {
454 List<ScenePresence> avatars = new List<ScenePresence>(); 449 List<ScenePresence> avatars = new List<ScenePresence>();
455 450
456 ForEachCurrentScene( 451 ForEachSelectedScene(
457 delegate(Scene scene) 452 delegate(Scene scene)
458 { 453 {
459 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) 454 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@@ -470,7 +465,7 @@ namespace OpenSim.Region.Framework.Scenes
470 { 465 {
471 List<ScenePresence> presences = new List<ScenePresence>(); 466 List<ScenePresence> presences = new List<ScenePresence>();
472 467
473 ForEachCurrentScene(delegate(Scene scene) 468 ForEachSelectedScene(delegate(Scene scene)
474 { 469 {
475 scene.ForEachScenePresence(delegate(ScenePresence sp) 470 scene.ForEachScenePresence(delegate(ScenePresence sp)
476 { 471 {
@@ -494,12 +489,12 @@ namespace OpenSim.Region.Framework.Scenes
494 489
495 public void ForceCurrentSceneClientUpdate() 490 public void ForceCurrentSceneClientUpdate()
496 { 491 {
497 ForEachCurrentScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); 492 ForEachSelectedScene(delegate(Scene scene) { scene.ForceClientUpdate(); });
498 } 493 }
499 494
500 public void HandleEditCommandOnCurrentScene(string[] cmdparams) 495 public void HandleEditCommandOnCurrentScene(string[] cmdparams)
501 { 496 {
502 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); 497 ForEachSelectedScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
503 } 498 }
504 499
505 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 500 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)