diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index ef98599..0838387 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -618,6 +618,28 @@ namespace OpenSim.Region.Environment.Scenes | |||
618 | 618 | ||
619 | return result; | 619 | return result; |
620 | } | 620 | } |
621 | |||
622 | /// <summary> | ||
623 | /// Get the controlling client for the given avatar, if there is one. | ||
624 | /// | ||
625 | /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't | ||
626 | /// use the ScenePresence. This could be better solved in a number of ways - we could establish an | ||
627 | /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more | ||
628 | /// suitable solution). | ||
629 | /// </summary> | ||
630 | /// <param name="agentId"></param> | ||
631 | /// <returns>null if either the avatar wasn't in the scene, or they do not have a controlling client</returns> | ||
632 | public IClientAPI GetControllingClient(LLUUID agentId) | ||
633 | { | ||
634 | ScenePresence presence = GetScenePresence(agentId); | ||
635 | |||
636 | if (presence != null) | ||
637 | { | ||
638 | return presence.ControllingClient; | ||
639 | } | ||
640 | |||
641 | return null; | ||
642 | } | ||
621 | 643 | ||
622 | /// <summary> | 644 | /// <summary> |
623 | /// Request a filtered list of m_scenePresences in this World | 645 | /// Request a filtered list of m_scenePresences in this World |
@@ -640,16 +662,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
640 | } | 662 | } |
641 | 663 | ||
642 | /// <summary> | 664 | /// <summary> |
643 | /// Request a Avatar by UUID | 665 | /// Request a scene presence by UUID |
644 | /// </summary> | 666 | /// </summary> |
645 | /// <param name="avatarID"></param> | 667 | /// <param name="avatarID"></param> |
646 | /// <returns></returns> | 668 | /// <returns>null if the agent was not found</returns> |
647 | public ScenePresence GetScenePresence(LLUUID avatarID) | 669 | public ScenePresence GetScenePresence(LLUUID agentID) |
648 | { | 670 | { |
649 | if (ScenePresences.ContainsKey(avatarID)) | 671 | if (ScenePresences.ContainsKey(agentID)) |
650 | { | 672 | { |
651 | return ScenePresences[avatarID]; | 673 | return ScenePresences[agentID]; |
652 | } | 674 | } |
675 | |||
653 | return null; | 676 | return null; |
654 | } | 677 | } |
655 | 678 | ||