From: Ansgar Schmidt <ANSI@de.ibm.com>

Here is a patch for Revision 3380. This patch adds the feature of loading
XML prim specification via XML-RPC call on a given island. Call with
Islandname and XMLPrim Filename.
ThreadPoolClientBranch
Sean Dague 2008-02-11 12:58:01 +00:00
parent c654df5dfd
commit c7c567182a
1 changed files with 48 additions and 0 deletions

View File

@ -70,6 +70,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod);
m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod);
m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod);
m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod);
} }
} }
catch (NullReferenceException) catch (NullReferenceException)
@ -336,6 +337,53 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
return response; return response;
} }
public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request)
{
m_log.Info("[RADMIN]: Received Load XML Administrator Request");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable();
if (requiredPassword != System.String.Empty &&
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
{
responseData["loaded"] = "false";
responseData["switched"] = "false";
response.Value = responseData;
}
else
{
try
{
string region_name = (string) requestData["region_name"];
string filename = (string) requestData["filename"];
if (m_app.SceneManager.TrySetCurrentScene(region_name))
{
m_log.Info("[RADMIN] Switched to region "+region_name);
responseData["switched"] = "true";
m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new LLVector3(0, 0, 0));
responseData["loaded"] = "true";
response.Value = responseData;
}
else
{
m_log.Info("[RADMIN] Failed to switch to region "+region_name);
responseData["loaded"] = "false";
responseData["switched"] = "false";
response.Value = responseData;
}
}
catch (Exception e)
{
responseData["loaded"] = "false";
responseData["error"] = e.ToString();
response.Value = responseData;
}
}
return response;
}
public void Close() public void Close()
{ {
} }