aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-03 18:13:32 +0000
committerJustin Clarke Casey2008-05-03 18:13:32 +0000
commita5dfca8958a28da415719ba880a77138ec205842 (patch)
treed5dfd209e082ee17e565e50cc17acc977b8b0565
parent* Refactor: remove pointless agentId parameter from CachedUserInfo.AddItem() (diff)
downloadopensim-SC_OLD-a5dfca8958a28da415719ba880a77138ec205842.zip
opensim-SC_OLD-a5dfca8958a28da415719ba880a77138ec205842.tar.gz
opensim-SC_OLD-a5dfca8958a28da415719ba880a77138ec205842.tar.bz2
opensim-SC_OLD-a5dfca8958a28da415719ba880a77138ec205842.tar.xz
* Refactor: remove redundant userId parameter from UpdateItem() and DeleteItem()
* Put warning in remove folder method about non implementation (not that this is used anyway - may be legacy)
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs21
3 files changed, 21 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index ca9669a..86c24bc 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -316,9 +316,9 @@ namespace OpenSim.Framework.Communications.Cache
316 /// </summary> 316 /// </summary>
317 /// <param name="userID"></param> 317 /// <param name="userID"></param>
318 /// <param name="itemInfo"></param> 318 /// <param name="itemInfo"></param>
319 public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo) 319 public void UpdateItem(InventoryItemBase itemInfo)
320 { 320 {
321 if ((userID == UserProfile.ID) && HasInventory) 321 if (HasInventory)
322 { 322 {
323 m_commsManager.InventoryService.UpdateItem(itemInfo); 323 m_commsManager.InventoryService.UpdateItem(itemInfo);
324 } 324 }
@@ -330,10 +330,10 @@ namespace OpenSim.Framework.Communications.Cache
330 /// <param name="userID"></param> 330 /// <param name="userID"></param>
331 /// <param name="item"></param> 331 /// <param name="item"></param>
332 /// <returns></returns> 332 /// <returns></returns>
333 public bool DeleteItem(LLUUID userID, InventoryItemBase item) 333 public bool DeleteItem(InventoryItemBase item)
334 { 334 {
335 bool result = false; 335 bool result = false;
336 if ((userID == UserProfile.ID) && HasInventory) 336 if (HasInventory)
337 { 337 {
338 result = RootFolder.DeleteItem(item.ID); 338 result = RootFolder.DeleteItem(item.ID);
339 if (result) 339 if (result)
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 19d2913..9a6b83a 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -364,7 +364,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
364 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset); 364 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset);
365 } 365 }
366 366
367 userInfo.UpdateItem(remoteClient.AgentId, item); 367 userInfo.UpdateItem(item);
368 } 368 }
369 } 369 }
370 } 370 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index baca696..59c45fa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Scenes
136 AssetCache.AddAsset(asset); 136 AssetCache.AddAsset(asset);
137 137
138 item.AssetID = asset.FullID; 138 item.AssetID = asset.FullID;
139 userInfo.UpdateItem(remoteClient.AgentId, item); 139 userInfo.UpdateItem(item);
140 140
141 // remoteClient.SendInventoryItemCreateUpdate(item); 141 // remoteClient.SendInventoryItemCreateUpdate(item);
142 if ((InventoryType) item.InvType == InventoryType.Notecard) 142 if ((InventoryType) item.InvType == InventoryType.Notecard)
@@ -294,7 +294,7 @@ namespace OpenSim.Region.Environment.Scenes
294 item.SaleType = itemUpd.SaleType; 294 item.SaleType = itemUpd.SaleType;
295 item.Flags = itemUpd.Flags; 295 item.Flags = itemUpd.Flags;
296 296
297 userInfo.UpdateItem(remoteClient.AgentId, item); 297 userInfo.UpdateItem(item);
298 } 298 }
299 else 299 else
300 { 300 {
@@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
486 item.Name = newName; 486 item.Name = newName;
487 } 487 }
488 item.Folder = folderID; 488 item.Folder = folderID;
489 userInfo.DeleteItem(remoteClient.AgentId, item); 489 userInfo.DeleteItem(item);
490 490
491 // TODO: preserve current permissions? 491 // TODO: preserve current permissions?
492 AddInventoryItem(remoteClient, item); 492 AddInventoryItem(remoteClient, item);
@@ -630,11 +630,17 @@ namespace OpenSim.Region.Environment.Scenes
630 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 630 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
631 if (item != null) 631 if (item != null)
632 { 632 {
633 userInfo.DeleteItem(remoteClient.AgentId, item); 633 userInfo.DeleteItem(item);
634 } 634 }
635 } 635 }
636 } 636 }
637 637
638 /// <summary>
639 /// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be
640 /// legacy and not currently used (purge folder is used to remove folders from trash instead).
641 /// </summary>
642 /// <param name="remoteClient"></param>
643 /// <param name="folderID"></param>
638 private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID) 644 private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID)
639 { 645 {
640 CachedUserInfo userInfo 646 CachedUserInfo userInfo
@@ -648,10 +654,15 @@ namespace OpenSim.Region.Environment.Scenes
648 if (userInfo.RootFolder != null) 654 if (userInfo.RootFolder != null)
649 { 655 {
650 InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID); 656 InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID);
657
651 if (folder != null) 658 if (folder != null)
652 { 659 {
660 m_log.WarnFormat(
661 "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}",
662 remoteClient.Name, remoteClient.AgentId, folderID);
663
653 // doesn't work just yet, commented out. will fix in next patch. 664 // doesn't work just yet, commented out. will fix in next patch.
654 // userInfo.DeleteItem(remoteClient.AgentId, folder); 665 // userInfo.DeleteItem(folder);
655 } 666 }
656 } 667 }
657 } 668 }