aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/CAPS/SimHttp.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/CAPS/SimHttp.cs29
1 files changed, 25 insertions, 4 deletions
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
50 private Thread m_workerThread; 50 private Thread m_workerThread;
51 private HttpListener m_httpListener; 51 private HttpListener m_httpListener;
52 private Dictionary<string, IRestHandler> m_restHandlers = new Dictionary<string, IRestHandler>(); 52 private Dictionary<string, IRestHandler> m_restHandlers = new Dictionary<string, IRestHandler>();
53 private Dictionary<string, IXmlRPCHandler> RPCHandlers = new Dictionary<string, IXmlRPCHandler>();
53 private IGridServer m_gridServer; 54 private IGridServer m_gridServer;
54 private int m_port; 55 private int m_port;
55 56
@@ -96,8 +97,22 @@ namespace OpenSim.CAPS
96 //must already have a handler for that path so return false 97 //must already have a handler for that path so return false
97 return false; 98 return false;
98 } 99 }
100
101 public bool AddXmlRPCHandler(string method, IXmlRPCHandler handler)
102 {
103 if (!this.RPCHandlers.ContainsKey(method))
104 {
105 this.RPCHandlers.Add(method, handler);
106 return true;
107 }
108
109 //must already have a handler for that path so return false
110 return false;
111 }
112
99 protected virtual string ParseXMLRPC(string requestBody) 113 protected virtual string ParseXMLRPC(string requestBody)
100 { 114 {
115 string responseString = "";
101 try 116 try
102 { 117 {
103 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); 118 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
@@ -115,17 +130,23 @@ namespace OpenSim.CAPS
115 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 130 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
116 if (m_gridServer.GetName() == "Remote") 131 if (m_gridServer.GetName() == "Remote")
117 { 132 {
118 133 ((RemoteGridBase) m_gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
119 ((RemoteGridBase)m_gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
120 } 134 }
121 return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; 135 responseString = "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>";
136 break;
137 default:
138 if (this.RPCHandlers.ContainsKey(request.MethodName))
139 {
140 //responseString = this.RPCHandlers[request.MethodName]
141 }
142 break;
122 } 143 }
123 } 144 }
124 catch (Exception e) 145 catch (Exception e)
125 { 146 {
126 Console.WriteLine(e.ToString()); 147 Console.WriteLine(e.ToString());
127 } 148 }
128 return ""; 149 return responseString;
129 } 150 }
130 151
131 protected virtual string ParseREST(string requestBody, string requestURL, string requestMethod) 152 protected virtual string ParseREST(string requestBody, string requestURL, string requestMethod)