diff options
Diffstat (limited to '')
9 files changed, 108 insertions, 100 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs index 717a097..c0ca1e1 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs | |||
@@ -101,18 +101,8 @@ namespace OpenSim.Capabilities.Handlers | |||
101 | llsdItem.item_id = invItem.ID; | 101 | llsdItem.item_id = invItem.ID; |
102 | llsdItem.name = invItem.Name; | 102 | llsdItem.name = invItem.Name; |
103 | llsdItem.parent_id = invItem.Folder; | 103 | llsdItem.parent_id = invItem.Folder; |
104 | 104 | llsdItem.type = invItem.AssetType; | |
105 | try | 105 | llsdItem.inv_type = invItem.InvType; |
106 | { | ||
107 | llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType); | ||
108 | llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType); | ||
109 | } | ||
110 | catch (Exception e) | ||
111 | { | ||
112 | m_log.ErrorFormat( | ||
113 | "[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}", | ||
114 | invItem.AssetType, invItem.InvType, invItem.Name, e.Message); | ||
115 | } | ||
116 | 106 | ||
117 | llsdItem.permissions = new LLSDPermissions(); | 107 | llsdItem.permissions = new LLSDPermissions(); |
118 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; | 108 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; |
@@ -126,21 +116,7 @@ namespace OpenSim.Capabilities.Handlers | |||
126 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; | 116 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; |
127 | llsdItem.sale_info = new LLSDSaleInfo(); | 117 | llsdItem.sale_info = new LLSDSaleInfo(); |
128 | llsdItem.sale_info.sale_price = invItem.SalePrice; | 118 | llsdItem.sale_info.sale_price = invItem.SalePrice; |
129 | switch (invItem.SaleType) | 119 | llsdItem.sale_info.sale_type = invItem.SaleType; |
130 | { | ||
131 | default: | ||
132 | llsdItem.sale_info.sale_type = "not"; | ||
133 | break; | ||
134 | case 1: | ||
135 | llsdItem.sale_info.sale_type = "original"; | ||
136 | break; | ||
137 | case 2: | ||
138 | llsdItem.sale_info.sale_type = "copy"; | ||
139 | break; | ||
140 | case 3: | ||
141 | llsdItem.sale_info.sale_type = "contents"; | ||
142 | break; | ||
143 | } | ||
144 | 120 | ||
145 | return llsdItem; | 121 | return llsdItem; |
146 | } | 122 | } |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs index 0ba8931..5bab52f 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs | |||
@@ -63,7 +63,8 @@ namespace OpenSim.Capabilities.Handlers | |||
63 | 63 | ||
64 | FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); | 64 | FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); |
65 | IRequestHandler reqHandler | 65 | IRequestHandler reqHandler |
66 | = new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest); | 66 | = new RestStreamHandler( |
67 | "POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null); | ||
67 | server.AddStreamHandler(reqHandler); | 68 | server.AddStreamHandler(reqHandler); |
68 | } | 69 | } |
69 | } | 70 | } |
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs index 2ecfa3c..8a275f3 100644 --- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs | |||
@@ -66,13 +66,14 @@ namespace OpenSim.Capabilities.Handlers | |||
66 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); | 66 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); |
67 | 67 | ||
68 | GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); | 68 | GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); |
69 | IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), | 69 | IRequestHandler reqHandler |
70 | delegate(Hashtable m_dhttpMethod) | 70 | = new RestHTTPHandler( |
71 | { | 71 | "GET", |
72 | return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); | 72 | "/CAPS/" + UUID.Random(), |
73 | }); | 73 | httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null), |
74 | "GetMesh", | ||
75 | null); | ||
74 | server.AddStreamHandler(reqHandler); | 76 | server.AddStreamHandler(reqHandler); |
75 | } | 77 | } |
76 | |||
77 | } | 78 | } |
78 | } | 79 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 0797215..f040ff7 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -58,8 +58,8 @@ namespace OpenSim.Capabilities.Handlers | |||
58 | // TODO: Change this to a config option | 58 | // TODO: Change this to a config option |
59 | const string REDIRECT_URL = null; | 59 | const string REDIRECT_URL = null; |
60 | 60 | ||
61 | public GetTextureHandler(string path, IAssetService assService) : | 61 | public GetTextureHandler(string path, IAssetService assService, string name, string description) |
62 | base("GET", path) | 62 | : base("GET", path, name, description) |
63 | { | 63 | { |
64 | m_assetService = assService; | 64 | m_assetService = assService; |
65 | } | 65 | } |
@@ -77,7 +77,6 @@ namespace OpenSim.Capabilities.Handlers | |||
77 | { | 77 | { |
78 | m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service"); | 78 | m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service"); |
79 | httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound; | 79 | httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound; |
80 | return null; | ||
81 | } | 80 | } |
82 | 81 | ||
83 | UUID textureID; | 82 | UUID textureID; |
@@ -115,7 +114,6 @@ namespace OpenSim.Capabilities.Handlers | |||
115 | // "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}", | 114 | // "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}", |
116 | // textureID, httpResponse.StatusCode, httpResponse.ContentLength); | 115 | // textureID, httpResponse.StatusCode, httpResponse.ContentLength); |
117 | 116 | ||
118 | httpResponse.Send(); | ||
119 | return null; | 117 | return null; |
120 | } | 118 | } |
121 | 119 | ||
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs index 0d072f7..71cf033 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs | |||
@@ -62,8 +62,8 @@ namespace OpenSim.Capabilities.Handlers | |||
62 | if (m_AssetService == null) | 62 | if (m_AssetService == null) |
63 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); | 63 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); |
64 | 64 | ||
65 | server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService)); | 65 | server.AddStreamHandler( |
66 | new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null)); | ||
66 | } | 67 | } |
67 | |||
68 | } | 68 | } |
69 | } | 69 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs index fd152c3..761e4e7 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs | |||
@@ -50,9 +50,9 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests | |||
50 | TestHelpers.InMethod(); | 50 | TestHelpers.InMethod(); |
51 | 51 | ||
52 | // Overkill - we only really need the asset service, not a whole scene. | 52 | // Overkill - we only really need the asset service, not a whole scene. |
53 | Scene scene = SceneHelpers.SetupScene(); | 53 | Scene scene = new SceneHelpers().SetupScene(); |
54 | 54 | ||
55 | GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); | 55 | GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null); |
56 | TestOSHttpRequest req = new TestOSHttpRequest(); | 56 | TestOSHttpRequest req = new TestOSHttpRequest(); |
57 | TestOSHttpResponse resp = new TestOSHttpResponse(); | 57 | TestOSHttpResponse resp = new TestOSHttpResponse(); |
58 | req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); | 58 | req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); |
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index 594ce9d..8849a59 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | |||
@@ -85,8 +85,8 @@ namespace OpenSim.Capabilities.Handlers | |||
85 | uploader.OnUpLoad += BakedTextureUploaded; | 85 | uploader.OnUpLoad += BakedTextureUploaded; |
86 | 86 | ||
87 | m_HostCapsObj.HttpListener.AddStreamHandler( | 87 | m_HostCapsObj.HttpListener.AddStreamHandler( |
88 | new BinaryStreamHandler("POST", capsBase + uploaderPath, | 88 | new BinaryStreamHandler( |
89 | uploader.uploaderCaps)); | 89 | "POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null)); |
90 | 90 | ||
91 | string protocol = "http://"; | 91 | string protocol = "http://"; |
92 | 92 | ||
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs index d5c062b..9a6ca86 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs | |||
@@ -156,11 +156,12 @@ namespace OpenSim.Capabilities.Handlers | |||
156 | inv.Folders = new List<InventoryFolderBase>(); | 156 | inv.Folders = new List<InventoryFolderBase>(); |
157 | inv.Items = new List<InventoryItemBase>(); | 157 | inv.Items = new List<InventoryItemBase>(); |
158 | int version = 0; | 158 | int version = 0; |
159 | int descendents = 0; | ||
159 | 160 | ||
160 | inv | 161 | inv |
161 | = Fetch( | 162 | = Fetch( |
162 | invFetch.owner_id, invFetch.folder_id, invFetch.owner_id, | 163 | invFetch.owner_id, invFetch.folder_id, invFetch.owner_id, |
163 | invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version); | 164 | invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version, out descendents); |
164 | 165 | ||
165 | if (inv != null && inv.Folders != null) | 166 | if (inv != null && inv.Folders != null) |
166 | { | 167 | { |
@@ -168,6 +169,8 @@ namespace OpenSim.Capabilities.Handlers | |||
168 | { | 169 | { |
169 | contents.categories.Array.Add(ConvertInventoryFolder(invFolder)); | 170 | contents.categories.Array.Add(ConvertInventoryFolder(invFolder)); |
170 | } | 171 | } |
172 | |||
173 | descendents += inv.Folders.Count; | ||
171 | } | 174 | } |
172 | 175 | ||
173 | if (inv != null && inv.Items != null) | 176 | if (inv != null && inv.Items != null) |
@@ -178,7 +181,7 @@ namespace OpenSim.Capabilities.Handlers | |||
178 | } | 181 | } |
179 | } | 182 | } |
180 | 183 | ||
181 | contents.descendents = contents.items.Array.Count + contents.categories.Array.Count; | 184 | contents.descendents = descendents; |
182 | contents.version = version; | 185 | contents.version = version; |
183 | 186 | ||
184 | // m_log.DebugFormat( | 187 | // m_log.DebugFormat( |
@@ -206,7 +209,7 @@ namespace OpenSim.Capabilities.Handlers | |||
206 | /// <returns>An empty InventoryCollection if the inventory look up failed</returns> | 209 | /// <returns>An empty InventoryCollection if the inventory look up failed</returns> |
207 | private InventoryCollection Fetch( | 210 | private InventoryCollection Fetch( |
208 | UUID agentID, UUID folderID, UUID ownerID, | 211 | UUID agentID, UUID folderID, UUID ownerID, |
209 | bool fetchFolders, bool fetchItems, int sortOrder, out int version) | 212 | bool fetchFolders, bool fetchItems, int sortOrder, out int version, out int descendents) |
210 | { | 213 | { |
211 | // m_log.DebugFormat( | 214 | // m_log.DebugFormat( |
212 | // "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", | 215 | // "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", |
@@ -215,6 +218,8 @@ namespace OpenSim.Capabilities.Handlers | |||
215 | // FIXME MAYBE: We're not handling sortOrder! | 218 | // FIXME MAYBE: We're not handling sortOrder! |
216 | 219 | ||
217 | version = 0; | 220 | version = 0; |
221 | descendents = 0; | ||
222 | |||
218 | InventoryFolderImpl fold; | 223 | InventoryFolderImpl fold; |
219 | if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner) | 224 | if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner) |
220 | { | 225 | { |
@@ -223,6 +228,7 @@ namespace OpenSim.Capabilities.Handlers | |||
223 | InventoryCollection ret = new InventoryCollection(); | 228 | InventoryCollection ret = new InventoryCollection(); |
224 | ret.Folders = new List<InventoryFolderBase>(); | 229 | ret.Folders = new List<InventoryFolderBase>(); |
225 | ret.Items = fold.RequestListOfItems(); | 230 | ret.Items = fold.RequestListOfItems(); |
231 | descendents = ret.Folders.Count + ret.Items.Count; | ||
226 | 232 | ||
227 | return ret; | 233 | return ret; |
228 | } | 234 | } |
@@ -246,24 +252,72 @@ namespace OpenSim.Capabilities.Handlers | |||
246 | 252 | ||
247 | version = containingFolder.Version; | 253 | version = containingFolder.Version; |
248 | 254 | ||
249 | // if (fetchItems) | 255 | if (fetchItems) |
256 | { | ||
257 | List<InventoryItemBase> itemsToReturn = contents.Items; | ||
258 | List<InventoryItemBase> originalItems = new List<InventoryItemBase>(itemsToReturn); | ||
259 | |||
260 | // descendents must only include the links, not the linked items we add | ||
261 | descendents = originalItems.Count; | ||
262 | |||
263 | // Add target items for links in this folder before the links themselves. | ||
264 | foreach (InventoryItemBase item in originalItems) | ||
265 | { | ||
266 | if (item.AssetType == (int)AssetType.Link) | ||
267 | { | ||
268 | InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | ||
269 | |||
270 | // Take care of genuinely broken links where the target doesn't exist | ||
271 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | ||
272 | // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles | ||
273 | // rather than having to keep track of every folder requested in the recursion. | ||
274 | if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) | ||
275 | itemsToReturn.Insert(0, linkedItem); | ||
276 | } | ||
277 | } | ||
278 | |||
279 | // Now scan for folder links and insert the items they target and those links at the head of the return data | ||
280 | foreach (InventoryItemBase item in originalItems) | ||
281 | { | ||
282 | if (item.AssetType == (int)AssetType.LinkFolder) | ||
283 | { | ||
284 | InventoryCollection linkedFolderContents = m_InventoryService.GetFolderContent(ownerID, item.AssetID); | ||
285 | List<InventoryItemBase> links = linkedFolderContents.Items; | ||
286 | |||
287 | itemsToReturn.InsertRange(0, links); | ||
288 | |||
289 | foreach (InventoryItemBase link in linkedFolderContents.Items) | ||
290 | { | ||
291 | // Take care of genuinely broken links where the target doesn't exist | ||
292 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | ||
293 | // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles | ||
294 | // rather than having to keep track of every folder requested in the recursion. | ||
295 | if (link != null) | ||
296 | { | ||
297 | // m_log.DebugFormat( | ||
298 | // "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3}", | ||
299 | // link.Name, (AssetType)link.AssetType, item.AssetID, containingFolder.Name); | ||
300 | |||
301 | InventoryItemBase linkedItem | ||
302 | = m_InventoryService.GetItem(new InventoryItemBase(link.AssetID)); | ||
303 | |||
304 | if (linkedItem != null) | ||
305 | itemsToReturn.Insert(0, linkedItem); | ||
306 | } | ||
307 | } | ||
308 | } | ||
309 | } | ||
310 | } | ||
311 | |||
312 | // foreach (InventoryItemBase item in contents.Items) | ||
250 | // { | 313 | // { |
251 | // List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>(); | 314 | // m_log.DebugFormat( |
252 | // | 315 | // "[WEB FETCH INV DESC HANDLER]: Returning item {0}, type {1}, parent {2} in {3} {4}", |
253 | // foreach (InventoryItemBase item in contents.Items) | 316 | // item.Name, (AssetType)item.AssetType, item.Folder, containingFolder.Name, containingFolder.ID); |
254 | // { | 317 | // } |
255 | // if (item.AssetType == (int)AssetType.Link) | 318 | |
256 | // { | 319 | // ===== |
257 | // InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | 320 | |
258 | // | ||
259 | // // Take care of genuinely broken links where the target doesn't exist | ||
260 | // // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | ||
261 | // // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles | ||
262 | // // rather than having to keep track of every folder requested in the recursion. | ||
263 | // if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) | ||
264 | // linkedItemsToAdd.Insert(0, linkedItem); | ||
265 | // } | ||
266 | // } | ||
267 | // | 321 | // |
268 | // foreach (InventoryItemBase linkedItem in linkedItemsToAdd) | 322 | // foreach (InventoryItemBase linkedItem in linkedItemsToAdd) |
269 | // { | 323 | // { |
@@ -340,12 +394,8 @@ namespace OpenSim.Capabilities.Handlers | |||
340 | llsdFolder.folder_id = invFolder.ID; | 394 | llsdFolder.folder_id = invFolder.ID; |
341 | llsdFolder.parent_id = invFolder.ParentID; | 395 | llsdFolder.parent_id = invFolder.ParentID; |
342 | llsdFolder.name = invFolder.Name; | 396 | llsdFolder.name = invFolder.Name; |
343 | 397 | llsdFolder.type = invFolder.Type; | |
344 | if (invFolder.Type == (short)AssetType.Unknown || !Enum.IsDefined(typeof(AssetType), (sbyte)invFolder.Type)) | 398 | llsdFolder.preferred_type = -1; |
345 | llsdFolder.type = "-1"; | ||
346 | else | ||
347 | llsdFolder.type = Utils.AssetTypeToString((AssetType)invFolder.Type); | ||
348 | llsdFolder.preferred_type = "-1"; | ||
349 | 399 | ||
350 | return llsdFolder; | 400 | return llsdFolder; |
351 | } | 401 | } |
@@ -365,18 +415,8 @@ namespace OpenSim.Capabilities.Handlers | |||
365 | llsdItem.item_id = invItem.ID; | 415 | llsdItem.item_id = invItem.ID; |
366 | llsdItem.name = invItem.Name; | 416 | llsdItem.name = invItem.Name; |
367 | llsdItem.parent_id = invItem.Folder; | 417 | llsdItem.parent_id = invItem.Folder; |
368 | 418 | llsdItem.type = invItem.AssetType; | |
369 | try | 419 | llsdItem.inv_type = invItem.InvType; |
370 | { | ||
371 | llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType); | ||
372 | llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType); | ||
373 | } | ||
374 | catch (Exception e) | ||
375 | { | ||
376 | m_log.ErrorFormat( | ||
377 | "[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}", | ||
378 | invItem.AssetType, invItem.InvType, invItem.Name, e.Message); | ||
379 | } | ||
380 | 420 | ||
381 | llsdItem.permissions = new LLSDPermissions(); | 421 | llsdItem.permissions = new LLSDPermissions(); |
382 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; | 422 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; |
@@ -390,21 +430,7 @@ namespace OpenSim.Capabilities.Handlers | |||
390 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; | 430 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; |
391 | llsdItem.sale_info = new LLSDSaleInfo(); | 431 | llsdItem.sale_info = new LLSDSaleInfo(); |
392 | llsdItem.sale_info.sale_price = invItem.SalePrice; | 432 | llsdItem.sale_info.sale_price = invItem.SalePrice; |
393 | switch (invItem.SaleType) | 433 | llsdItem.sale_info.sale_type = invItem.SaleType; |
394 | { | ||
395 | default: | ||
396 | llsdItem.sale_info.sale_type = "not"; | ||
397 | break; | ||
398 | case 1: | ||
399 | llsdItem.sale_info.sale_type = "original"; | ||
400 | break; | ||
401 | case 2: | ||
402 | llsdItem.sale_info.sale_type = "copy"; | ||
403 | break; | ||
404 | case 3: | ||
405 | llsdItem.sale_info.sale_type = "contents"; | ||
406 | break; | ||
407 | } | ||
408 | 434 | ||
409 | return llsdItem; | 435 | return llsdItem; |
410 | } | 436 | } |
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs index 92eeb14..5d86557 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs | |||
@@ -68,7 +68,13 @@ namespace OpenSim.Capabilities.Handlers | |||
68 | ServerUtils.LoadPlugin<ILibraryService>(libService, args); | 68 | ServerUtils.LoadPlugin<ILibraryService>(libService, args); |
69 | 69 | ||
70 | WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); | 70 | WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); |
71 | IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest); | 71 | IRequestHandler reqHandler |
72 | = new RestStreamHandler( | ||
73 | "POST", | ||
74 | "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, | ||
75 | webFetchHandler.FetchInventoryDescendentsRequest, | ||
76 | "WebFetchInvDesc", | ||
77 | null); | ||
72 | server.AddStreamHandler(reqHandler); | 78 | server.AddStreamHandler(reqHandler); |
73 | } | 79 | } |
74 | 80 | ||