aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Capabilities/Caps.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Capabilities/Caps.cs')
-rw-r--r--OpenSim/Framework/Communications/Capabilities/Caps.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index f9af7ea..53cb955 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.Capabilities
66 //private string m_requestTexture = "0003/"; 66 //private string m_requestTexture = "0003/";
67 private string m_notecardUpdatePath = "0004/"; 67 private string m_notecardUpdatePath = "0004/";
68 private string m_notecardTaskUpdatePath = "0005/"; 68 private string m_notecardTaskUpdatePath = "0005/";
69 private string m_fetchInventoryPath = "0006/";
69 70
70 //private string eventQueue = "0100/"; 71 //private string eventQueue = "0100/";
71 private BaseHttpServer m_httpListener; 72 private BaseHttpServer m_httpListener;
@@ -110,10 +111,17 @@ namespace OpenSim.Region.Capabilities
110 capsBase + m_newInventory, 111 capsBase + m_newInventory,
111 NewAgentInventoryRequest)); 112 NewAgentInventoryRequest));
112 113
114 // m_httpListener.AddStreamHandler(
115 // new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST",
116 // capsBase + m_fetchInventory,
117 // FetchInventory));
118
119
113 AddLegacyCapsHandler(m_httpListener, m_requestPath, CapsRequest); 120 AddLegacyCapsHandler(m_httpListener, m_requestPath, CapsRequest);
114 //AddLegacyCapsHandler(m_httpListener, m_requestTexture , RequestTexture); 121 //AddLegacyCapsHandler(m_httpListener, m_requestTexture , RequestTexture);
115 AddLegacyCapsHandler(m_httpListener, m_notecardUpdatePath, NoteCardAgentInventory); 122 AddLegacyCapsHandler(m_httpListener, m_notecardUpdatePath, NoteCardAgentInventory);
116 AddLegacyCapsHandler(m_httpListener, m_notecardTaskUpdatePath, ScriptTaskInventory); 123 AddLegacyCapsHandler(m_httpListener, m_notecardTaskUpdatePath, ScriptTaskInventory);
124 AddLegacyCapsHandler(m_httpListener, m_fetchInventoryPath, FetchInventoryRequest);
117 } 125 }
118 catch (Exception e) 126 catch (Exception e)
119 { 127 {
@@ -160,9 +168,37 @@ namespace OpenSim.Region.Capabilities
160 caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; 168 caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath;
161 caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; 169 caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath;
162 caps.UpdateScriptTaskInventory = capsBaseUrl + m_notecardTaskUpdatePath; 170 caps.UpdateScriptTaskInventory = capsBaseUrl + m_notecardTaskUpdatePath;
171 caps.FetchInventoryDescendents = capsBaseUrl + m_fetchInventoryPath;
163 return caps; 172 return caps;
164 } 173 }
165 174
175 public string FetchInventoryRequest(string request, string path, string param)
176 {
177 request = request.Replace("<llsd><map><key>folders</key><array>", "<llsd>");
178 request = request.Replace("</map></array></map>", "</map>");
179
180 //Console.WriteLine("inventory request " + request);
181 Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request));
182 LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
183 LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
184 LLSDInventoryDescendents reply = FetchInventory(llsdRequest);
185 string response = LLSDHelpers.SerialiseLLSDReply(reply);
186 return response;
187 }
188
189 private LLSDInventoryDescendents FetchInventory(LLSDFetchInventoryDescendents invFetch)
190 {
191 LLSDInventoryDescendents reply = new LLSDInventoryDescendents();
192 LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents();
193 contents.agent___id = m_agentID;
194 contents.owner___id = m_agentID;
195 contents.folder___id = invFetch.folder_id;
196 contents.version = 1;
197 contents.descendents = 0;
198 reply.folders.Array.Add(contents);
199 return reply;
200 }
201
166 /// <summary> 202 /// <summary>
167 /// 203 ///
168 /// </summary> 204 /// </summary>