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.cs48
1 files changed, 10 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 1e2e973..28f7896 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -331,35 +331,30 @@ namespace OpenSim.Region.Framework.Scenes
331 331
332 public void SendCommandToPluginModules(string[] cmdparams) 332 public void SendCommandToPluginModules(string[] cmdparams)
333 { 333 {
334 ForEachCurrentScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); 334 ForEachSelectedScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); });
335 } 335 }
336 336
337 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) 337 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
338 { 338 {
339 ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); 339 ForEachSelectedScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); });
340 } 340 }
341 341
342 private void ForEachCurrentScene(Action<Scene> func) 342 public void ForEachSelectedScene(Action<Scene> func)
343 { 343 {
344 if (CurrentScene == null) 344 if (CurrentScene == null)
345 { 345 ForEachScene(func);
346 lock (m_localScenes)
347 m_localScenes.ForEach(func);
348 }
349 else 346 else
350 {
351 func(CurrentScene); 347 func(CurrentScene);
352 }
353 } 348 }
354 349
355 public void RestartCurrentScene() 350 public void RestartCurrentScene()
356 { 351 {
357 ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); 352 ForEachSelectedScene(delegate(Scene scene) { scene.RestartNow(); });
358 } 353 }
359 354
360 public void BackupCurrentScene() 355 public void BackupCurrentScene()
361 { 356 {
362 ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); 357 ForEachSelectedScene(delegate(Scene scene) { scene.Backup(true); });
363 } 358 }
364 359
365 public bool TrySetCurrentScene(string regionName) 360 public bool TrySetCurrentScene(string regionName)
@@ -482,34 +477,11 @@ namespace OpenSim.Region.Framework.Scenes
482 return false; 477 return false;
483 } 478 }
484 479
485 /// <summary>
486 /// Set the debug packet level on each current scene. This level governs which packets are printed out to the
487 /// console.
488 /// </summary>
489 /// <param name="newDebug"></param>
490 /// <param name="name">Name of avatar to debug</param>
491 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
492 {
493 ForEachCurrentScene(scene =>
494 scene.ForEachScenePresence(sp =>
495 {
496 if (name == null || sp.Name == name)
497 {
498 m_log.DebugFormat(
499 "Packet debug for {0} ({1}) set to {2}",
500 sp.Name, sp.IsChildAgent ? "child" : "root", newDebug);
501
502 sp.ControllingClient.DebugPacketLevel = newDebug;
503 }
504 })
505 );
506 }
507
508 public List<ScenePresence> GetCurrentSceneAvatars() 480 public List<ScenePresence> GetCurrentSceneAvatars()
509 { 481 {
510 List<ScenePresence> avatars = new List<ScenePresence>(); 482 List<ScenePresence> avatars = new List<ScenePresence>();
511 483
512 ForEachCurrentScene( 484 ForEachSelectedScene(
513 delegate(Scene scene) 485 delegate(Scene scene)
514 { 486 {
515 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) 487 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@@ -526,7 +498,7 @@ namespace OpenSim.Region.Framework.Scenes
526 { 498 {
527 List<ScenePresence> presences = new List<ScenePresence>(); 499 List<ScenePresence> presences = new List<ScenePresence>();
528 500
529 ForEachCurrentScene(delegate(Scene scene) 501 ForEachSelectedScene(delegate(Scene scene)
530 { 502 {
531 scene.ForEachScenePresence(delegate(ScenePresence sp) 503 scene.ForEachScenePresence(delegate(ScenePresence sp)
532 { 504 {
@@ -555,12 +527,12 @@ namespace OpenSim.Region.Framework.Scenes
555 527
556 public void ForceCurrentSceneClientUpdate() 528 public void ForceCurrentSceneClientUpdate()
557 { 529 {
558 ForEachCurrentScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); 530 ForEachSelectedScene(delegate(Scene scene) { scene.ForceClientUpdate(); });
559 } 531 }
560 532
561 public void HandleEditCommandOnCurrentScene(string[] cmdparams) 533 public void HandleEditCommandOnCurrentScene(string[] cmdparams)
562 { 534 {
563 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); 535 ForEachSelectedScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
564 } 536 }
565 537
566 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 538 public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)