diff options
RIP OpenSimRoot. (removed)
Merged most of the bug fixes etc in from LLdemo branch.
Added the textures from that branch.
Diffstat (limited to 'OpenSim.RegionServer/CAPS')
-rw-r--r-- | OpenSim.RegionServer/CAPS/IXmlRPCHandler.cs | 11 | ||||
-rw-r--r-- | OpenSim.RegionServer/CAPS/SimHttp.cs | 29 |
2 files changed, 36 insertions, 4 deletions
diff --git a/OpenSim.RegionServer/CAPS/IXmlRPCHandler.cs b/OpenSim.RegionServer/CAPS/IXmlRPCHandler.cs new file mode 100644 index 0000000..c3cbbcc --- /dev/null +++ b/OpenSim.RegionServer/CAPS/IXmlRPCHandler.cs | |||
@@ -0,0 +1,11 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.CAPS | ||
6 | { | ||
7 | public interface IXmlRPCHandler | ||
8 | { | ||
9 | string HandleRPC(string requestBody); | ||
10 | } | ||
11 | } | ||
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) |