aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs4
2 files changed, 13 insertions, 18 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)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index df819ec..6e0ea7d 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Framework.Tests
130 SceneObjectPart sop1 = sog1.RootPart; 130 SceneObjectPart sop1 = sog1.RootPart;
131 TaskInventoryItem sopItem1 131 TaskInventoryItem sopItem1
132 = TaskInventoryHelpers.AddNotecard( 132 = TaskInventoryHelpers.AddNotecard(
133 scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); 133 scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
134 134
135 InventoryFolderBase folder 135 InventoryFolderBase folder
136 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; 136 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Tests
162 SceneObjectPart sop1 = sog1.RootPart; 162 SceneObjectPart sop1 = sog1.RootPart;
163 TaskInventoryItem sopItem1 163 TaskInventoryItem sopItem1
164 = TaskInventoryHelpers.AddNotecard( 164 = TaskInventoryHelpers.AddNotecard(
165 scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); 165 scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
166 166
167 // Perform test 167 // Perform test
168 scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); 168 scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID);