diff options
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 6983479..5d44b2a 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -137,6 +137,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
137 | availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod); | 137 | availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod); |
138 | 138 | ||
139 | // Agent management | 139 | // Agent management |
140 | availableMethods["admin_get_agents"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetAgentsMethod); | ||
140 | availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod); | 141 | availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod); |
141 | 142 | ||
142 | // User management | 143 | // User management |
@@ -1760,6 +1761,71 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1760 | m_log.Info("[RADMIN]: Access List List Request complete"); | 1761 | m_log.Info("[RADMIN]: Access List List Request complete"); |
1761 | } | 1762 | } |
1762 | 1763 | ||
1764 | private void XmlRpcGetAgentsMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | ||
1765 | { | ||
1766 | Hashtable responseData = (Hashtable)response.Value; | ||
1767 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
1768 | |||
1769 | bool includeChildren = false; | ||
1770 | |||
1771 | if (requestData.Contains("include_children")) | ||
1772 | bool.TryParse((string)requestData["include_children"], out includeChildren); | ||
1773 | |||
1774 | Scene scene; | ||
1775 | GetSceneFromRegionParams(requestData, responseData, out scene); | ||
1776 | |||
1777 | ArrayList xmlRpcRegions = new ArrayList(); | ||
1778 | responseData["regions"] = xmlRpcRegions; | ||
1779 | |||
1780 | Hashtable xmlRpcRegion = new Hashtable(); | ||
1781 | xmlRpcRegions.Add(xmlRpcRegion); | ||
1782 | |||
1783 | xmlRpcRegion["name"] = scene.Name; | ||
1784 | xmlRpcRegion["id"] = scene.RegionInfo.RegionID.ToString(); | ||
1785 | |||
1786 | List<ScenePresence> agents = scene.GetScenePresences(); | ||
1787 | ArrayList xmlrpcAgents = new ArrayList(); | ||
1788 | |||
1789 | foreach (ScenePresence agent in agents) | ||
1790 | { | ||
1791 | if (agent.IsChildAgent && !includeChildren) | ||
1792 | continue; | ||
1793 | |||
1794 | Hashtable xmlRpcAgent = new Hashtable(); | ||
1795 | xmlRpcAgent.Add("name", agent.Name); | ||
1796 | xmlRpcAgent.Add("id", agent.UUID.ToString()); | ||
1797 | xmlRpcAgent.Add("type", agent.PresenceType.ToString()); | ||
1798 | xmlRpcAgent.Add("current_parcel_id", agent.currentParcelUUID.ToString()); | ||
1799 | |||
1800 | Vector3 pos = agent.AbsolutePosition; | ||
1801 | xmlRpcAgent.Add("pos_x", pos.X.ToString()); | ||
1802 | xmlRpcAgent.Add("pos_y", pos.Y.ToString()); | ||
1803 | xmlRpcAgent.Add("pos_z", pos.Z.ToString()); | ||
1804 | |||
1805 | Vector3 lookAt = agent.Lookat; | ||
1806 | xmlRpcAgent.Add("lookat_x", lookAt.X.ToString()); | ||
1807 | xmlRpcAgent.Add("lookat_y", lookAt.Y.ToString()); | ||
1808 | xmlRpcAgent.Add("lookat_z", lookAt.Z.ToString()); | ||
1809 | |||
1810 | Vector3 vel = agent.Velocity; | ||
1811 | xmlRpcAgent.Add("vel_x", vel.X.ToString()); | ||
1812 | xmlRpcAgent.Add("vel_y", vel.Y.ToString()); | ||
1813 | xmlRpcAgent.Add("vel_z", vel.Z.ToString()); | ||
1814 | |||
1815 | xmlRpcAgent.Add("is_flying", agent.Flying.ToString()); | ||
1816 | xmlRpcAgent.Add("is_sat_on_ground", agent.SitGround.ToString()); | ||
1817 | xmlRpcAgent.Add("is_sat_on_object", agent.IsSatOnObject.ToString()); | ||
1818 | |||
1819 | xmlrpcAgents.Add(xmlRpcAgent); | ||
1820 | } | ||
1821 | |||
1822 | m_log.DebugFormat( | ||
1823 | "[REMOTE ADMIN]: XmlRpcGetAgents found {0} agents in {1}", xmlrpcAgents.Count, scene.Name); | ||
1824 | |||
1825 | xmlRpcRegion["agents"] = xmlrpcAgents; | ||
1826 | responseData["success"] = true; | ||
1827 | } | ||
1828 | |||
1763 | private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | 1829 | private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) |
1764 | { | 1830 | { |
1765 | Hashtable responseData = (Hashtable)response.Value; | 1831 | Hashtable responseData = (Hashtable)response.Value; |