From 415b7b7ec4be9f87e7d5b65000e092d3372a4391 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 7 Dec 2011 17:31:57 +0000 Subject: Implement XMLRPCAdmin command admin_teleport_agent. This allows someone with access to this command on the XMLRPCAdmin interface to teleport an avatar to an arbitrary region and/or position. --- OpenSim/Region/Framework/Scenes/Scene.cs | 6 ++--- OpenSim/Region/Framework/Scenes/SceneBase.cs | 6 +++++ OpenSim/Region/Framework/Scenes/SceneManager.cs | 33 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3ac6327..604f035 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4206,7 +4206,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void ForEachRootScenePresence(Action action) { - if(m_sceneGraph != null) + if (m_sceneGraph != null) { m_sceneGraph.ForEachAvatar(action); } @@ -4286,9 +4286,9 @@ namespace OpenSim.Region.Framework.Scenes return m_sceneGraph.GetGroupByPrim(localID); } - public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) + public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp) { - return m_sceneGraph.TryGetScenePresence(avatarId, out avatar); + return m_sceneGraph.TryGetScenePresence(agentID, out sp); } public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 0336fe5..a633c72 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -191,6 +191,12 @@ namespace OpenSim.Region.Framework.Scenes return false; } + /// + /// Try to get a scene presence from the scene + /// + /// + /// null if there is no scene presence with the given agent id + /// true if there was a scene presence with the given id, false otherwise. public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); #endregion diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 82458e2..0491205 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -545,6 +545,23 @@ namespace OpenSim.Region.Framework.Scenes return false; } + public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar) + { + lock (m_localScenes) + { + foreach (Scene scene in m_localScenes) + { + avatar = scene.GetScenePresence(avatarId); + + if (avatar != null && !avatar.IsChildAgent) + return true; + } + } + + avatar = null; + return false; + } + public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) { ScenePresence avatar = null; @@ -590,6 +607,22 @@ namespace OpenSim.Region.Framework.Scenes return false; } + public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp) + { + lock (m_localScenes) + { + foreach (Scene scene in m_localScenes) + { + sp = scene.GetScenePresence(firstName, lastName); + if (sp != null && !sp.IsChildAgent) + return true; + } + } + + sp = null; + return false; + } + public void ForEachScene(Action action) { lock (m_localScenes) -- cgit v1.1