diff options
author | Diva Canto | 2009-08-19 10:56:08 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-19 10:56:08 -0700 |
commit | d519f1885f587409592cf92bc0f4ba8533a1866f (patch) | |
tree | dc8d0073d09050c8787121290b1e3a8f65119812 /OpenSim/Region/CoreModules/ServiceConnectorsOut | |
parent | Async purge so that the client thread doesn't wait. (diff) | |
download | opensim-SC_OLD-d519f1885f587409592cf92bc0f4ba8533a1866f.zip opensim-SC_OLD-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.gz opensim-SC_OLD-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.bz2 opensim-SC_OLD-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.xz |
Added MoveItems, which is most useful upon viewer-delete inventory operation. Moving a batch of items is a 1-time operation. Made it async anyway, so that the viewer doesn't wait in case the DB layer is dumb (which is the case currently).
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
4 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index d1ae3e4..d4cb616 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -181,6 +181,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
181 | /// <returns>true if the item was successfully updated</returns> | 181 | /// <returns>true if the item was successfully updated</returns> |
182 | public abstract bool UpdateItem(InventoryItemBase item); | 182 | public abstract bool UpdateItem(InventoryItemBase item); |
183 | 183 | ||
184 | public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
185 | |||
184 | /// <summary> | 186 | /// <summary> |
185 | /// Delete an item from the user's inventory | 187 | /// Delete an item from the user's inventory |
186 | /// </summary> | 188 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 6a1f2d5..787c6c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -393,6 +393,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
393 | } | 393 | } |
394 | } | 394 | } |
395 | 395 | ||
396 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
397 | { | ||
398 | if (items == null) | ||
399 | return false; | ||
400 | if (items.Count == 0) | ||
401 | return true; | ||
402 | |||
403 | if (IsLocalGridUser(ownerID)) | ||
404 | return m_GridService.MoveItems(ownerID, items); | ||
405 | else | ||
406 | { | ||
407 | UUID sessionID = GetSessionID(ownerID); | ||
408 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
409 | return m_HGService.MoveItems(uri, items, sessionID); | ||
410 | } | ||
411 | } | ||
412 | |||
396 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 413 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
397 | { | 414 | { |
398 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); | 415 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index b2640af..562c5dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -289,6 +289,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
289 | return m_InventoryService.UpdateItem(item); | 289 | return m_InventoryService.UpdateItem(item); |
290 | } | 290 | } |
291 | 291 | ||
292 | |||
293 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
294 | { | ||
295 | return m_InventoryService.MoveItems(ownerID, items); | ||
296 | } | ||
297 | |||
292 | /// <summary> | 298 | /// <summary> |
293 | /// Delete an item from the user's inventory | 299 | /// Delete an item from the user's inventory |
294 | /// </summary> | 300 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 081d0f7..201442c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -273,6 +273,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
274 | } | 274 | } |
275 | 275 | ||
276 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
277 | { | ||
278 | if (items == null) | ||
279 | return false; | ||
280 | |||
281 | UUID sessionID = GetSessionID(ownerID); | ||
282 | return m_RemoteConnector.MoveItems(ownerID.ToString(), items, sessionID); | ||
283 | } | ||
284 | |||
285 | |||
276 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 286 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
277 | { | 287 | { |
278 | if (itemIDs == null) | 288 | if (itemIDs == null) |