aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Capabilities/Caps.cs
diff options
context:
space:
mode:
authorMW2008-03-15 11:48:27 +0000
committerMW2008-03-15 11:48:27 +0000
commit70e55205a19ca83aa2f63c2b2c5d2c300e2324f6 (patch)
tree947d7bff36771428f0e6eb8bb8405dc3db247be3 /OpenSim/Framework/Communications/Capabilities/Caps.cs
parent* Fix for Justincc's bug report #768 - Terrain looks rather phallic. (diff)
downloadopensim-SC_OLD-70e55205a19ca83aa2f63c2b2c5d2c300e2324f6.zip
opensim-SC_OLD-70e55205a19ca83aa2f63c2b2c5d2c300e2324f6.tar.gz
opensim-SC_OLD-70e55205a19ca83aa2f63c2b2c5d2c300e2324f6.tar.bz2
opensim-SC_OLD-70e55205a19ca83aa2f63c2b2c5d2c300e2324f6.tar.xz
Part 1 of making inventory work again in the 1.19.1 (RC) client. Implemented the FetchInventoryDescendents CAPS handler. But currently returning empty folder details.
So this commit doesn't actually fix inventory in that client, it just stops the "loading" message being displayed forever next to a folder, and instead shows empty folders. Next part will be to fill in the details of the items in the folders.
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>