From 98d81485e724b26d9ad35b9b7cd24c98808b9a81 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 28 Mar 2007 13:08:27 +0000 Subject: RIP OpenSimRoot. (removed) Merged most of the bug fixes etc in from LLdemo branch. Added the textures from that branch. --- OpenSim.RegionServer/CAPS/SimHttp.cs | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'OpenSim.RegionServer/CAPS/SimHttp.cs') diff --git a/OpenSim.RegionServer/CAPS/SimHttp.cs b/OpenSim.RegionServer/CAPS/SimHttp.cs index 92bbc6f..bfba635 100644 --- a/OpenSim.RegionServer/CAPS/SimHttp.cs +++ b/OpenSim.RegionServer/CAPS/SimHttp.cs @@ -50,6 +50,7 @@ namespace OpenSim.CAPS private Thread m_workerThread; private HttpListener m_httpListener; private Dictionary m_restHandlers = new Dictionary(); + private Dictionary RPCHandlers = new Dictionary(); private IGridServer m_gridServer; private int m_port; @@ -96,8 +97,22 @@ namespace OpenSim.CAPS //must already have a handler for that path so return false return false; } + + public bool AddXmlRPCHandler(string method, IXmlRPCHandler handler) + { + if (!this.RPCHandlers.ContainsKey(method)) + { + this.RPCHandlers.Add(method, handler); + return true; + } + + //must already have a handler for that path so return false + return false; + } + protected virtual string ParseXMLRPC(string requestBody) { + string responseString = ""; try { XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); @@ -115,17 +130,23 @@ namespace OpenSim.CAPS agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); if (m_gridServer.GetName() == "Remote") { - - ((RemoteGridBase)m_gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); + ((RemoteGridBase) m_gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); } - return ""; + responseString = ""; + break; + default: + if (this.RPCHandlers.ContainsKey(request.MethodName)) + { + //responseString = this.RPCHandlers[request.MethodName] + } + break; } } catch (Exception e) { Console.WriteLine(e.ToString()); } - return ""; + return responseString; } protected virtual string ParseREST(string requestBody, string requestURL, string requestMethod) -- cgit v1.1