diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 82458e2..d73a959 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -545,23 +545,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
545 | return false; | 545 | return false; |
546 | } | 546 | } |
547 | 547 | ||
548 | public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) | 548 | public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar) |
549 | { | 549 | { |
550 | ScenePresence avatar = null; | ||
551 | |||
552 | lock (m_localScenes) | 550 | lock (m_localScenes) |
553 | { | 551 | { |
554 | foreach (Scene mScene in m_localScenes) | 552 | foreach (Scene scene in m_localScenes) |
555 | { | 553 | { |
556 | if (mScene.TryGetScenePresence(avatarId, out avatar)) | 554 | avatar = scene.GetScenePresence(avatarId); |
557 | { | 555 | |
558 | scene = mScene; | 556 | if (avatar != null && !avatar.IsChildAgent) |
559 | return true; | 557 | return true; |
560 | } | ||
561 | } | 558 | } |
562 | } | 559 | } |
563 | 560 | ||
564 | scene = null; | 561 | avatar = null; |
565 | return false; | 562 | return false; |
566 | } | 563 | } |
567 | 564 | ||
@@ -590,6 +587,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
590 | return false; | 587 | return false; |
591 | } | 588 | } |
592 | 589 | ||
590 | public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp) | ||
591 | { | ||
592 | lock (m_localScenes) | ||
593 | { | ||
594 | foreach (Scene scene in m_localScenes) | ||
595 | { | ||
596 | sp = scene.GetScenePresence(firstName, lastName); | ||
597 | if (sp != null && !sp.IsChildAgent) | ||
598 | return true; | ||
599 | } | ||
600 | } | ||
601 | |||
602 | sp = null; | ||
603 | return false; | ||
604 | } | ||
605 | |||
593 | public void ForEachScene(Action<Scene> action) | 606 | public void ForEachScene(Action<Scene> action) |
594 | { | 607 | { |
595 | lock (m_localScenes) | 608 | lock (m_localScenes) |