diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-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 f19e391..e50dac6 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -141,6 +141,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
141 | availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod); | 141 | availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod); |
142 | 142 | ||
143 | // Agent management | 143 | // Agent management |
144 | availableMethods["admin_get_agents"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetAgentsMethod); | ||
144 | availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod); | 145 | availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod); |
145 | 146 | ||
146 | // User management | 147 | // User management |
@@ -1901,6 +1902,71 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1901 | m_log.Info("[RADMIN]: Access List List Request complete"); | 1902 | m_log.Info("[RADMIN]: Access List List Request complete"); |
1902 | } | 1903 | } |
1903 | 1904 | ||
1905 | private void XmlRpcGetAgentsMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | ||
1906 | { | ||
1907 | Hashtable responseData = (Hashtable)response.Value; | ||
1908 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
1909 | |||
1910 | bool includeChildren = false; | ||
1911 | |||
1912 | if (requestData.Contains("include_children")) | ||
1913 | bool.TryParse((string)requestData["include_children"], out includeChildren); | ||
1914 | |||
1915 | Scene scene; | ||
1916 | GetSceneFromRegionParams(requestData, responseData, out scene); | ||
1917 | |||
1918 | ArrayList xmlRpcRegions = new ArrayList(); | ||
1919 | responseData["regions"] = xmlRpcRegions; | ||
1920 | |||
1921 | Hashtable xmlRpcRegion = new Hashtable(); | ||
1922 | xmlRpcRegions.Add(xmlRpcRegion); | ||
1923 | |||
1924 | xmlRpcRegion["name"] = scene.Name; | ||
1925 | xmlRpcRegion["id"] = scene.RegionInfo.RegionID.ToString(); | ||
1926 | |||
1927 | List<ScenePresence> agents = scene.GetScenePresences(); | ||
1928 | ArrayList xmlrpcAgents = new ArrayList(); | ||
1929 | |||
1930 | foreach (ScenePresence agent in agents) | ||
1931 | { | ||
1932 | if (agent.IsChildAgent && !includeChildren) | ||
1933 | continue; | ||
1934 | |||
1935 | Hashtable xmlRpcAgent = new Hashtable(); | ||
1936 | xmlRpcAgent.Add("name", agent.Name); | ||
1937 | xmlRpcAgent.Add("id", agent.UUID.ToString()); | ||
1938 | xmlRpcAgent.Add("type", agent.PresenceType.ToString()); | ||
1939 | xmlRpcAgent.Add("current_parcel_id", agent.currentParcelUUID.ToString()); | ||
1940 | |||
1941 | Vector3 pos = agent.AbsolutePosition; | ||
1942 | xmlRpcAgent.Add("pos_x", pos.X.ToString()); | ||
1943 | xmlRpcAgent.Add("pos_y", pos.Y.ToString()); | ||
1944 | xmlRpcAgent.Add("pos_z", pos.Z.ToString()); | ||
1945 | |||
1946 | Vector3 lookAt = agent.Lookat; | ||
1947 | xmlRpcAgent.Add("lookat_x", lookAt.X.ToString()); | ||
1948 | xmlRpcAgent.Add("lookat_y", lookAt.Y.ToString()); | ||
1949 | xmlRpcAgent.Add("lookat_z", lookAt.Z.ToString()); | ||
1950 | |||
1951 | Vector3 vel = agent.Velocity; | ||
1952 | xmlRpcAgent.Add("vel_x", vel.X.ToString()); | ||
1953 | xmlRpcAgent.Add("vel_y", vel.Y.ToString()); | ||
1954 | xmlRpcAgent.Add("vel_z", vel.Z.ToString()); | ||
1955 | |||
1956 | xmlRpcAgent.Add("is_flying", agent.Flying.ToString()); | ||
1957 | xmlRpcAgent.Add("is_sat_on_ground", agent.SitGround.ToString()); | ||
1958 | xmlRpcAgent.Add("is_sat_on_object", agent.IsSatOnObject.ToString()); | ||
1959 | |||
1960 | xmlrpcAgents.Add(xmlRpcAgent); | ||
1961 | } | ||
1962 | |||
1963 | m_log.DebugFormat( | ||
1964 | "[REMOTE ADMIN]: XmlRpcGetAgents found {0} agents in {1}", xmlrpcAgents.Count, scene.Name); | ||
1965 | |||
1966 | xmlRpcRegion["agents"] = xmlrpcAgents; | ||
1967 | responseData["success"] = true; | ||
1968 | } | ||
1969 | |||
1904 | private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | 1970 | private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) |
1905 | { | 1971 | { |
1906 | Hashtable responseData = (Hashtable)response.Value; | 1972 | Hashtable responseData = (Hashtable)response.Value; |