aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-11 18:46:54 +0000
committerJustin Clarke Casey2008-04-11 18:46:54 +0000
commit7ac7f79f88f51504680a24f1621115c595492f62 (patch)
treea1b29254a35ca97f4d44dffa1bb4bd2eb863e938 /OpenSim/Region/Communications
parent* Minor inventory code cleanup following on from last patch (diff)
downloadopensim-SC_OLD-7ac7f79f88f51504680a24f1621115c595492f62.zip
opensim-SC_OLD-7ac7f79f88f51504680a24f1621115c595492f62.tar.gz
opensim-SC_OLD-7ac7f79f88f51504680a24f1621115c595492f62.tar.bz2
opensim-SC_OLD-7ac7f79f88f51504680a24f1621115c595492f62.tar.xz
* Eliminate a class of errors where an inventory request could be made before the region had completely received the inventory for the user.
* A much larger race condition where the inventory request could be made before the region gets any data at all will also be fixed in the near future. * This change also fixes a regression from two patches ago where items stopped appearing in standalone inventory
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs11
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs3
2 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index e81a39f..dafd637 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -39,13 +39,18 @@ namespace OpenSim.Region.Communications.Local
39 /// </summary> 39 /// </summary>
40 public class LocalInventoryService : InventoryServiceBase 40 public class LocalInventoryService : InventoryServiceBase
41 { 41 {
42 private static readonly log4net.ILog m_log
43 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44
42 public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) 45 public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback)
43 { 46 {
47 m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID);
48
44 List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID); 49 List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID);
45 InventoryFolderImpl rootFolder = null; 50 InventoryFolderImpl rootFolder = null;
46 51
47 ICollection<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); 52 List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
48 ICollection<InventoryItemBase> items = new List<InventoryItemBase>(); 53 List<InventoryItemBase> items = new List<InventoryItemBase>();
49 54
50 // Need to retrieve the root folder on the first pass 55 // Need to retrieve the root folder on the first pass
51 foreach (InventoryFolderBase folder in skeletonFolders) 56 foreach (InventoryFolderBase folder in skeletonFolders)
@@ -54,6 +59,7 @@ namespace OpenSim.Region.Communications.Local
54 { 59 {
55 rootFolder = new InventoryFolderImpl(folder); 60 rootFolder = new InventoryFolderImpl(folder);
56 folders.Add(rootFolder); 61 folders.Add(rootFolder);
62 items.AddRange(RequestFolderItems(rootFolder.ID));
57 } 63 }
58 } 64 }
59 65
@@ -64,6 +70,7 @@ namespace OpenSim.Region.Communications.Local
64 if (folder.ID != rootFolder.ID) 70 if (folder.ID != rootFolder.ID)
65 { 71 {
66 folders.Add(new InventoryFolderImpl(folder)); 72 folders.Add(new InventoryFolderImpl(folder));
73 items.AddRange(RequestFolderItems(folder.ID));
67 } 74 }
68 } 75 }
69 } 76 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index dc26ce2..8f293f9 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -38,7 +38,8 @@ namespace OpenSim.Region.Communications.OGS1
38{ 38{
39 public class OGS1InventoryService : IInventoryServices 39 public class OGS1InventoryService : IInventoryServices
40 { 40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly log4net.ILog m_log
42 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 43
43 private string _inventoryServerUrl; 44 private string _inventoryServerUrl;
44 private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>(); 45 private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>();