diff options
author | diva | 2009-03-26 04:14:33 +0000 |
---|---|---|
committer | diva | 2009-03-26 04:14:33 +0000 |
commit | de3971a8d374f6ef04b1e946bb848b1238ef0acb (patch) | |
tree | 63bac0209d3e27916c6e9508be5113875b4da344 /OpenSim/Region | |
parent | Half-way through supporting inventory access from outside the regions -- HG s... (diff) | |
download | opensim-SC_OLD-de3971a8d374f6ef04b1e946bb848b1238ef0acb.zip opensim-SC_OLD-de3971a8d374f6ef04b1e946bb848b1238ef0acb.tar.gz opensim-SC_OLD-de3971a8d374f6ef04b1e946bb848b1238ef0acb.tar.bz2 opensim-SC_OLD-de3971a8d374f6ef04b1e946bb848b1238ef0acb.tar.xz |
One more -- CopyItem.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Hypergrid/HGStandaloneInventoryService.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneInventoryService.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneInventoryService.cs index 879e885..b67f6f3 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneInventoryService.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneInventoryService.cs | |||
@@ -399,6 +399,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
399 | } | 399 | } |
400 | 400 | ||
401 | } | 401 | } |
402 | |||
402 | public InventoryItemBase DeleteItem(InventoryItemBase item) | 403 | public InventoryItemBase DeleteItem(InventoryItemBase item) |
403 | { | 404 | { |
404 | item = m_inventoryService.GetInventoryItem(item.ID); | 405 | item = m_inventoryService.GetInventoryItem(item.ID); |
@@ -411,6 +412,35 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
411 | } | 412 | } |
412 | } | 413 | } |
413 | 414 | ||
415 | public InventoryItemBase CopyItem(InventoryItemBase olditem) | ||
416 | { | ||
417 | InventoryItemBase Item = m_inventoryService.GetInventoryItem(olditem.ID); // this is the old item id | ||
418 | // BIG HACK here | ||
419 | UUID newID = olditem.AssetID; | ||
420 | if (Item != null) | ||
421 | { | ||
422 | if (olditem.Name != String.Empty) | ||
423 | { | ||
424 | Item.Name = olditem.Name; | ||
425 | } | ||
426 | Item.ID = newID; | ||
427 | Item.Folder = olditem.Folder; | ||
428 | // There should be some tests here about the owner, etc but I'm going to ignore that | ||
429 | // because I'm not sure it makes any sense | ||
430 | |||
431 | // Also I should probably close the asset... | ||
432 | m_inventoryService.AddItem(Item); | ||
433 | return Item; | ||
434 | } | ||
435 | else | ||
436 | { | ||
437 | m_log.Debug("[HGStandaloneInvService]: Failed to find item " + olditem.ID); | ||
438 | olditem.ID = UUID.Zero; | ||
439 | return olditem; | ||
440 | } | ||
441 | |||
442 | } | ||
443 | |||
414 | /// <summary> | 444 | /// <summary> |
415 | /// Guid to UUID wrapper for same name IInventoryServices method | 445 | /// Guid to UUID wrapper for same name IInventoryServices method |
416 | /// </summary> | 446 | /// </summary> |
@@ -650,6 +680,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
650 | "POST", AddAndGetCapUrl(authToken, "/MoveItem/", caps), MoveItem, CheckAuthSession)); | 680 | "POST", AddAndGetCapUrl(authToken, "/MoveItem/", caps), MoveItem, CheckAuthSession)); |
651 | httpServer.AddStreamHandler(new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | 681 | httpServer.AddStreamHandler(new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( |
652 | "POST", AddAndGetCapUrl(authToken, "/DeleteItem/", caps), DeleteItem, CheckAuthSession)); | 682 | "POST", AddAndGetCapUrl(authToken, "/DeleteItem/", caps), DeleteItem, CheckAuthSession)); |
683 | httpServer.AddStreamHandler(new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | ||
684 | "POST", AddAndGetCapUrl(authToken, "/CopyItem/", caps), CopyItem, CheckAuthSession)); | ||
653 | 685 | ||
654 | httpServer.AddStreamHandler(new RestDeserialiseSecureHandler<InventoryItemBase, AssetBase>( | 686 | httpServer.AddStreamHandler(new RestDeserialiseSecureHandler<InventoryItemBase, AssetBase>( |
655 | "POST", AddAndGetCapUrl(authToken, "/GetAsset/", caps), GetAsset, CheckAuthSession)); | 687 | "POST", AddAndGetCapUrl(authToken, "/GetAsset/", caps), GetAsset, CheckAuthSession)); |