aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-03 23:33:20 +0000
committerJustin Clarke Casey2008-05-03 23:33:20 +0000
commit27a7391d6b3df7d5e3d688ae27fa3ff21dcf421f (patch)
tree84c1527d51ce2386290c87a762265886fc2aa827 /OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
parent* Refactor RemoveItem() (diff)
downloadopensim-SC_OLD-27a7391d6b3df7d5e3d688ae27fa3ff21dcf421f.zip
opensim-SC_OLD-27a7391d6b3df7d5e3d688ae27fa3ff21dcf421f.tar.gz
opensim-SC_OLD-27a7391d6b3df7d5e3d688ae27fa3ff21dcf421f.tar.bz2
opensim-SC_OLD-27a7391d6b3df7d5e3d688ae27fa3ff21dcf421f.tar.xz
* Add ability to defer item actions for AddItem() and DeleteItem(). This won't be useful until we let the client cache (again?)
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs26
1 files changed, 21 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 84e42a3..6f7c4da 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -35,6 +35,8 @@ using log4net;
35 35
36namespace OpenSim.Framework.Communications.Cache 36namespace OpenSim.Framework.Communications.Cache
37{ 37{
38 internal delegate void AddItemDelegate(InventoryItemBase itemInfo);
39 internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
38 internal delegate void DeleteItemDelegate(LLUUID itemID); 40 internal delegate void DeleteItemDelegate(LLUUID itemID);
39 41
40 internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID); 42 internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID);
@@ -532,13 +534,20 @@ namespace OpenSim.Framework.Communications.Cache
532 /// Add an item to the user's inventory 534 /// Add an item to the user's inventory
533 /// </summary> 535 /// </summary>
534 /// <param name="itemInfo"></param> 536 /// <param name="itemInfo"></param>
535 public void AddItem(InventoryItemBase itemInfo) 537 public void AddItem(InventoryItemBase item)
536 { 538 {
537 if (HasInventory) 539 if (HasInventory)
538 { 540 {
539 ItemReceive(itemInfo); 541 ItemReceive(item);
540 m_commsManager.InventoryService.AddItem(itemInfo); 542 m_commsManager.InventoryService.AddItem(item);
541 } 543 }
544 else
545 {
546 AddRequest(
547 new InventoryRequest(
548 Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"),
549 new object[] { item }));
550 }
542 } 551 }
543 552
544 /// <summary> 553 /// <summary>
@@ -546,12 +555,19 @@ namespace OpenSim.Framework.Communications.Cache
546 /// </summary> 555 /// </summary>
547 /// <param name="userID"></param> 556 /// <param name="userID"></param>
548 /// <param name="itemInfo"></param> 557 /// <param name="itemInfo"></param>
549 public void UpdateItem(InventoryItemBase itemInfo) 558 public void UpdateItem(InventoryItemBase item)
550 { 559 {
551 if (HasInventory) 560 if (HasInventory)
552 { 561 {
553 m_commsManager.InventoryService.UpdateItem(itemInfo); 562 m_commsManager.InventoryService.UpdateItem(item);
554 } 563 }
564 else
565 {
566 AddRequest(
567 new InventoryRequest(
568 Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"),
569 new object[] { item }));
570 }
555 } 571 }
556 572
557 /// <summary> 573 /// <summary>