aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/InventoryService.cs
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-25 16:13:02 -0400
committerTeravus Ovares (Dan Olivares)2009-08-25 16:13:02 -0400
commita7917b428a6bc3c9e33da64879b9e473516540a3 (patch)
tree2c38d9c33c4977a3d0356912915082a8bd568a23 /OpenSim/Services/InventoryService/InventoryService.cs
parentPatch from jhurliman to HttpServer (diff)
parentImplemented osPenCap, that sets EndCap and StartCap to Pen. This allows using... (diff)
downloadopensim-SC-a7917b428a6bc3c9e33da64879b9e473516540a3.zip
opensim-SC-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.gz
opensim-SC-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.bz2
opensim-SC-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.xz
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Services/InventoryService/InventoryService.cs')
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs54
1 files changed, 43 insertions, 11 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index 65c2d96..19b1fd8 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -235,8 +235,6 @@ namespace OpenSim.Services.InventoryService
235 235
236 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 236 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
237 { 237 {
238 m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID);
239
240 // Uncomment me to simulate a slow responding inventory server 238 // Uncomment me to simulate a slow responding inventory server
241 //Thread.Sleep(16000); 239 //Thread.Sleep(16000);
242 240
@@ -249,7 +247,7 @@ namespace OpenSim.Services.InventoryService
249 invCollection.Folders = folders; 247 invCollection.Folders = folders;
250 invCollection.Items = items; 248 invCollection.Items = items;
251 249
252 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); 250 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID);
253 251
254 return invCollection; 252 return invCollection;
255 } 253 }
@@ -386,13 +384,33 @@ namespace OpenSim.Services.InventoryService
386 return true; 384 return true;
387 } 385 }
388 386
387 public virtual bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
388 {
389 m_log.InfoFormat(
390 "[INVENTORY SERVICE]: Moving {0} items from user {1}", items.Count, ownerID);
391
392 InventoryItemBase itm = null;
393 foreach (InventoryItemBase item in items)
394 {
395 itm = GetInventoryItem(item.ID);
396 itm.Folder = item.Folder;
397 if ((item.Name != null) && !item.Name.Equals(string.Empty))
398 itm.Name = item.Name;
399 m_Database.updateInventoryItem(itm);
400 }
401
402 return true;
403 }
404
389 // See IInventoryServices 405 // See IInventoryServices
390 public virtual bool DeleteItem(InventoryItemBase item) 406 public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs)
391 { 407 {
392 m_log.InfoFormat( 408 m_log.InfoFormat(
393 "[INVENTORY SERVICE]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); 409 "[INVENTORY SERVICE]: Deleting {0} items from user {1}", itemIDs.Count, owner);
394 410
395 m_Database.deleteInventoryItem(item.ID); 411 // uhh.....
412 foreach (UUID uuid in itemIDs)
413 m_Database.deleteInventoryItem(uuid);
396 414
397 // FIXME: Should return false on failure 415 // FIXME: Should return false on failure
398 return true; 416 return true;
@@ -400,22 +418,34 @@ namespace OpenSim.Services.InventoryService
400 418
401 public virtual InventoryItemBase GetItem(InventoryItemBase item) 419 public virtual InventoryItemBase GetItem(InventoryItemBase item)
402 { 420 {
403 InventoryItemBase result = m_Database.queryInventoryItem(item.ID); 421 InventoryItemBase result = m_Database.getInventoryItem(item.ID);
404 if (result != null) 422 if (result != null)
405 return result; 423 return result;
406 424 m_log.DebugFormat("[INVENTORY SERVICE]: GetItem failed to find item {0}", item.ID);
407 return null; 425 return null;
408 } 426 }
409 427
410 public virtual InventoryFolderBase GetFolder(InventoryFolderBase item) 428 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
411 { 429 {
412 InventoryFolderBase result = m_Database.queryInventoryFolder(item.ID); 430 InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID);
413 if (result != null) 431 if (result != null)
414 return result; 432 return result;
415 433
434 m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID);
416 return null; 435 return null;
417 } 436 }
418 437
438 public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
439 {
440 foreach (UUID id in folderIDs)
441 {
442 InventoryFolderBase folder = new InventoryFolderBase(id, ownerID);
443 PurgeFolder(folder);
444 m_Database.deleteInventoryFolder(id);
445 }
446 return true;
447 }
448
419 /// <summary> 449 /// <summary>
420 /// Purge a folder of all items items and subfolders. 450 /// Purge a folder of all items items and subfolders.
421 /// 451 ///
@@ -439,10 +469,12 @@ namespace OpenSim.Services.InventoryService
439 469
440 List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); 470 List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID);
441 471
472 List<UUID> uuids = new List<UUID>();
442 foreach (InventoryItemBase item in items) 473 foreach (InventoryItemBase item in items)
443 { 474 {
444 DeleteItem(item); 475 uuids.Add(item.ID);
445 } 476 }
477 DeleteItems(folder.Owner, uuids);
446 478
447 // FIXME: Should return false on failure 479 // FIXME: Should return false on failure
448 return true; 480 return true;