aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-07 17:31:57 +0000
committerJustin Clark-Casey (justincc)2011-12-07 17:31:57 +0000
commit415b7b7ec4be9f87e7d5b65000e092d3372a4391 (patch)
tree315ba0fc1f42a542a274b997b0d62a490ef78e73 /OpenSim/Region
parentproperly lock CapsHandlers.m_capsHandlers (diff)
downloadopensim-SC-415b7b7ec4be9f87e7d5b65000e092d3372a4391.zip
opensim-SC-415b7b7ec4be9f87e7d5b65000e092d3372a4391.tar.gz
opensim-SC-415b7b7ec4be9f87e7d5b65000e092d3372a4391.tar.bz2
opensim-SC-415b7b7ec4be9f87e7d5b65000e092d3372a4391.tar.xz
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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs33
3 files changed, 42 insertions, 3 deletions
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
4206 /// <param name="action"></param> 4206 /// <param name="action"></param>
4207 public void ForEachRootScenePresence(Action<ScenePresence> action) 4207 public void ForEachRootScenePresence(Action<ScenePresence> action)
4208 { 4208 {
4209 if(m_sceneGraph != null) 4209 if (m_sceneGraph != null)
4210 { 4210 {
4211 m_sceneGraph.ForEachAvatar(action); 4211 m_sceneGraph.ForEachAvatar(action);
4212 } 4212 }
@@ -4286,9 +4286,9 @@ namespace OpenSim.Region.Framework.Scenes
4286 return m_sceneGraph.GetGroupByPrim(localID); 4286 return m_sceneGraph.GetGroupByPrim(localID);
4287 } 4287 }
4288 4288
4289 public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 4289 public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp)
4290 { 4290 {
4291 return m_sceneGraph.TryGetScenePresence(avatarId, out avatar); 4291 return m_sceneGraph.TryGetScenePresence(agentID, out sp);
4292 } 4292 }
4293 4293
4294 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) 4294 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
191 return false; 191 return false;
192 } 192 }
193 193
194 /// <summary>
195 /// Try to get a scene presence from the scene
196 /// </summary>
197 /// <param name="agentID"></param>
198 /// <param name="scenePresence">null if there is no scene presence with the given agent id</param>
199 /// <returns>true if there was a scene presence with the given id, false otherwise.</returns>
194 public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); 200 public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence);
195 201
196 #endregion 202 #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
545 return false; 545 return false;
546 } 546 }
547 547
548 public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar)
549 {
550 lock (m_localScenes)
551 {
552 foreach (Scene scene in m_localScenes)
553 {
554 avatar = scene.GetScenePresence(avatarId);
555
556 if (avatar != null && !avatar.IsChildAgent)
557 return true;
558 }
559 }
560
561 avatar = null;
562 return false;
563 }
564
548 public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) 565 public bool TryGetAvatarsScene(UUID avatarId, out Scene scene)
549 { 566 {
550 ScenePresence avatar = null; 567 ScenePresence avatar = null;
@@ -590,6 +607,22 @@ namespace OpenSim.Region.Framework.Scenes
590 return false; 607 return false;
591 } 608 }
592 609
610 public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp)
611 {
612 lock (m_localScenes)
613 {
614 foreach (Scene scene in m_localScenes)
615 {
616 sp = scene.GetScenePresence(firstName, lastName);
617 if (sp != null && !sp.IsChildAgent)
618 return true;
619 }
620 }
621
622 sp = null;
623 return false;
624 }
625
593 public void ForEachScene(Action<Scene> action) 626 public void ForEachScene(Action<Scene> action)
594 { 627 {
595 lock (m_localScenes) 628 lock (m_localScenes)