diff options
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetTransactions.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 40 |
2 files changed, 32 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 7f52739..addd20a 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
156 | } | 156 | } |
157 | if (this.OnUpLoad != null) | 157 | if (this.OnUpLoad != null) |
158 | { | 158 | { |
159 | this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); | 159 | this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data, "" , ""); |
160 | } | 160 | } |
161 | return text; | 161 | return text; |
162 | } | 162 | } |
@@ -373,7 +373,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
373 | } | 373 | } |
374 | if (this.OnUpLoad != null) | 374 | if (this.OnUpLoad != null) |
375 | { | 375 | { |
376 | this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data); | 376 | this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data, "" , "" ); |
377 | } | 377 | } |
378 | return text; | 378 | return text; |
379 | } | 379 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 14f9c95..6afb35c 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -39,7 +39,7 @@ using OpenSim.Framework.Data; | |||
39 | 39 | ||
40 | namespace OpenSim.Region.Capabilities | 40 | namespace OpenSim.Region.Capabilities |
41 | { | 41 | { |
42 | public delegate void UpLoadedAsset(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data); | 42 | public delegate void UpLoadedAsset(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data, string inventoryType, string assetType); |
43 | public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); | 43 | public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); |
44 | public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); | 44 | public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); |
45 | public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); | 45 | public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Capabilities | |||
113 | /// <returns></returns> | 113 | /// <returns></returns> |
114 | public string CapsRequest(string request, string path, string param) | 114 | public string CapsRequest(string request, string path, string param) |
115 | { | 115 | { |
116 | //Console.WriteLine("caps request " + request); | 116 | // Console.WriteLine("caps request " + request); |
117 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); | 117 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); |
118 | return result; | 118 | return result; |
119 | } | 119 | } |
@@ -270,7 +270,7 @@ namespace OpenSim.Region.Capabilities | |||
270 | /// <returns></returns> | 270 | /// <returns></returns> |
271 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) | 271 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) |
272 | { | 272 | { |
273 | // Console.WriteLine("asset upload request via CAPS"); | 273 | //Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); |
274 | 274 | ||
275 | string assetName = llsdRequest.name; | 275 | string assetName = llsdRequest.name; |
276 | string assetDes = llsdRequest.description; | 276 | string assetDes = llsdRequest.description; |
@@ -280,7 +280,7 @@ namespace OpenSim.Region.Capabilities | |||
280 | LLUUID parentFolder = llsdRequest.folder_id; | 280 | LLUUID parentFolder = llsdRequest.folder_id; |
281 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 281 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
282 | 282 | ||
283 | AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, "" , "", capsBase + uploaderPath, this.httpListener); | 283 | AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener); |
284 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 284 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
285 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; | 285 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; |
286 | 286 | ||
@@ -297,13 +297,27 @@ namespace OpenSim.Region.Capabilities | |||
297 | /// <param name="assetID"></param> | 297 | /// <param name="assetID"></param> |
298 | /// <param name="inventoryItem"></param> | 298 | /// <param name="inventoryItem"></param> |
299 | /// <param name="data"></param> | 299 | /// <param name="data"></param> |
300 | public void UploadCompleteHandler(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data) | 300 | public void UploadCompleteHandler(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data, string inventoryType, string assetType) |
301 | { | 301 | { |
302 | sbyte assType = 0; | ||
303 | sbyte inType = 0; | ||
304 | |||
305 | if (inventoryType == "sound") | ||
306 | { | ||
307 | inType = 1; | ||
308 | assType = 1; | ||
309 | } | ||
310 | else if (inventoryType == "animation") | ||
311 | { | ||
312 | inType = 19; | ||
313 | assType = 19; | ||
314 | } | ||
315 | |||
302 | AssetBase asset; | 316 | AssetBase asset; |
303 | asset = new AssetBase(); | 317 | asset = new AssetBase(); |
304 | asset.FullID = assetID; | 318 | asset.FullID = assetID; |
305 | asset.Type = 0; | 319 | asset.Type = assType; |
306 | asset.InvType = 0; | 320 | asset.InvType = inType; |
307 | asset.Name = assetName; | 321 | asset.Name = assetName; |
308 | asset.Data = data; | 322 | asset.Data = data; |
309 | this.assetCache.AddAsset(asset); | 323 | this.assetCache.AddAsset(asset); |
@@ -315,8 +329,8 @@ namespace OpenSim.Region.Capabilities | |||
315 | item.assetID = asset.FullID; | 329 | item.assetID = asset.FullID; |
316 | item.inventoryDescription = assetDescription; | 330 | item.inventoryDescription = assetDescription; |
317 | item.inventoryName = assetName; | 331 | item.inventoryName = assetName; |
318 | item.assetType = 0; | 332 | item.assetType = assType; |
319 | item.invType = 0; | 333 | item.invType = inType; |
320 | item.parentFolderID = parentFolder; | 334 | item.parentFolderID = parentFolder; |
321 | item.inventoryCurrentPermissions = 2147483647; | 335 | item.inventoryCurrentPermissions = 2147483647; |
322 | item.inventoryNextPermissions = 2147483647; | 336 | item.inventoryNextPermissions = 2147483647; |
@@ -350,6 +364,9 @@ namespace OpenSim.Region.Capabilities | |||
350 | private string m_assetName = ""; | 364 | private string m_assetName = ""; |
351 | private string m_assetDes = ""; | 365 | private string m_assetDes = ""; |
352 | 366 | ||
367 | private string m_invType = ""; | ||
368 | private string m_assetType = ""; | ||
369 | |||
353 | /// <summary> | 370 | /// <summary> |
354 | /// | 371 | /// |
355 | /// </summary> | 372 | /// </summary> |
@@ -366,6 +383,9 @@ namespace OpenSim.Region.Capabilities | |||
366 | uploaderPath = path; | 383 | uploaderPath = path; |
367 | httpListener = httpServer; | 384 | httpListener = httpServer; |
368 | parentFolder = parentFolderID; | 385 | parentFolder = parentFolderID; |
386 | m_assetType = assetType; | ||
387 | m_invType = invType; | ||
388 | |||
369 | } | 389 | } |
370 | 390 | ||
371 | /// <summary> | 391 | /// <summary> |
@@ -393,7 +413,7 @@ namespace OpenSim.Region.Capabilities | |||
393 | 413 | ||
394 | if (OnUpLoad != null) | 414 | if (OnUpLoad != null) |
395 | { | 415 | { |
396 | OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data); | 416 | OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType); |
397 | } | 417 | } |
398 | 418 | ||
399 | return res; | 419 | return res; |