diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 9b2e331..bcf9d87 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -383,6 +383,48 @@ namespace OpenSim.Services.Connectors | |||
383 | return false; | 383 | return false; |
384 | } | 384 | } |
385 | 385 | ||
386 | /** | ||
387 | * MoveItems Async group | ||
388 | */ | ||
389 | |||
390 | delegate void MoveItemsDelegate(string userID, List<InventoryItemBase> items, UUID sessionID); | ||
391 | |||
392 | private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID) | ||
393 | { | ||
394 | try | ||
395 | { | ||
396 | SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject( | ||
397 | "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString()); | ||
398 | |||
399 | // Success | ||
400 | return; | ||
401 | } | ||
402 | catch (Exception e) | ||
403 | { | ||
404 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: Move inventory items operation failed, {0} {1} (old server?). Trying slow way.", | ||
405 | e.Source, e.Message); | ||
406 | } | ||
407 | |||
408 | foreach (InventoryItemBase item in items) | ||
409 | { | ||
410 | InventoryItemBase itm = this.QueryItem(userID, item, sessionID); | ||
411 | itm.Name = item.Name; | ||
412 | itm.Folder = item.Folder; | ||
413 | this.UpdateItem(userID, itm, sessionID); | ||
414 | } | ||
415 | } | ||
416 | |||
417 | private void MoveItemsCompleted(IAsyncResult iar) | ||
418 | { | ||
419 | } | ||
420 | |||
421 | public bool MoveItems(string userID, List<InventoryItemBase> items, UUID sessionID) | ||
422 | { | ||
423 | MoveItemsDelegate d = MoveItemsAsync; | ||
424 | d.BeginInvoke(userID, items, sessionID, MoveItemsCompleted, d); | ||
425 | return true; | ||
426 | } | ||
427 | |||
386 | public bool DeleteItems(string userID, List<UUID> items, UUID sessionID) | 428 | public bool DeleteItems(string userID, List<UUID> items, UUID sessionID) |
387 | { | 429 | { |
388 | try | 430 | try |