diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index c2e3370..3b84734 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -414,22 +414,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
414 | ForEachCurrentScene( | 414 | ForEachCurrentScene( |
415 | delegate(Scene scene) | 415 | delegate(Scene scene) |
416 | { | 416 | { |
417 | ScenePresence[] scenePresences = scene.GetScenePresences(); | 417 | scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
418 | |||
419 | for (int i = 0; i < scenePresences.Length; i++) | ||
420 | { | 418 | { |
421 | ScenePresence scenePresence = scenePresences[i]; | ||
422 | |||
423 | if (!scenePresence.IsChildAgent) | 419 | if (!scenePresence.IsChildAgent) |
424 | { | 420 | { |
425 | m_log.ErrorFormat("Packet debug for {0} {1} set to {2}", | 421 | m_log.DebugFormat("Packet debug for {0} {1} set to {2}", |
426 | scenePresence.Firstname, | 422 | scenePresence.Firstname, |
427 | scenePresence.Lastname, | 423 | scenePresence.Lastname, |
428 | newDebug); | 424 | newDebug); |
429 | 425 | ||
430 | scenePresence.ControllingClient.SetDebugPacketLevel(newDebug); | 426 | scenePresence.ControllingClient.SetDebugPacketLevel(newDebug); |
431 | } | 427 | } |
432 | } | 428 | }); |
433 | } | 429 | } |
434 | ); | 430 | ); |
435 | } | 431 | } |
@@ -441,14 +437,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
441 | ForEachCurrentScene( | 437 | ForEachCurrentScene( |
442 | delegate(Scene scene) | 438 | delegate(Scene scene) |
443 | { | 439 | { |
444 | ScenePresence[] scenePresences = scene.GetScenePresences(); | 440 | scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
445 | |||
446 | for (int i = 0; i < scenePresences.Length; i++) | ||
447 | { | 441 | { |
448 | ScenePresence scenePresence = scenePresences[i]; | ||
449 | if (!scenePresence.IsChildAgent) | 442 | if (!scenePresence.IsChildAgent) |
450 | avatars.Add(scenePresence); | 443 | avatars.Add(scenePresence); |
451 | } | 444 | }); |
452 | } | 445 | } |
453 | ); | 446 | ); |
454 | 447 | ||
@@ -461,18 +454,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
461 | 454 | ||
462 | ForEachCurrentScene(delegate(Scene scene) | 455 | ForEachCurrentScene(delegate(Scene scene) |
463 | { | 456 | { |
464 | ScenePresence[] scenePresences = scene.GetScenePresences(); | 457 | scene.ForEachScenePresence(delegate(ScenePresence sp) |
465 | presences.AddRange(scenePresences); | 458 | { |
459 | presences.Add(sp); | ||
460 | }); | ||
466 | }); | 461 | }); |
467 | 462 | ||
468 | return presences; | 463 | return presences; |
469 | } | 464 | } |
470 | 465 | ||
471 | public RegionInfo GetRegionInfo(ulong regionHandle) | 466 | public RegionInfo GetRegionInfo(UUID regionID) |
472 | { | 467 | { |
473 | foreach (Scene scene in m_localScenes) | 468 | foreach (Scene scene in m_localScenes) |
474 | { | 469 | { |
475 | if (scene.RegionInfo.RegionHandle == regionHandle) | 470 | if (scene.RegionInfo.RegionID == regionID) |
476 | { | 471 | { |
477 | return scene.RegionInfo; | 472 | return scene.RegionInfo; |
478 | } | 473 | } |
@@ -491,11 +486,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
491 | ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); | 486 | ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); |
492 | } | 487 | } |
493 | 488 | ||
494 | public bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) | 489 | public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) |
495 | { | 490 | { |
496 | foreach (Scene scene in m_localScenes) | 491 | foreach (Scene scene in m_localScenes) |
497 | { | 492 | { |
498 | if (scene.TryGetAvatar(avatarId, out avatar)) | 493 | if (scene.TryGetScenePresence(avatarId, out avatar)) |
499 | { | 494 | { |
500 | return true; | 495 | return true; |
501 | } | 496 | } |
@@ -510,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
510 | ScenePresence avatar = null; | 505 | ScenePresence avatar = null; |
511 | foreach (Scene mScene in m_localScenes) | 506 | foreach (Scene mScene in m_localScenes) |
512 | { | 507 | { |
513 | if (mScene.TryGetAvatar(avatarId, out avatar)) | 508 | if (mScene.TryGetScenePresence(avatarId, out avatar)) |
514 | { | 509 | { |
515 | scene = mScene; | 510 | scene = mScene; |
516 | return true; | 511 | return true; |