aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-03-28 19:35:01 +0000
committerJustin Clarke Casey2008-03-28 19:35:01 +0000
commit0a47a75b8894942e43a132c8479b1b17e7d4e8b5 (patch)
tree34de4749fe3a83f2335667aabf58537845ecab00
parent* Refactor: Eliminate RequestUsersRoot() redundant method (diff)
downloadopensim-SC_OLD-0a47a75b8894942e43a132c8479b1b17e7d4e8b5.zip
opensim-SC_OLD-0a47a75b8894942e43a132c8479b1b17e7d4e8b5.tar.gz
opensim-SC_OLD-0a47a75b8894942e43a132c8479b1b17e7d4e8b5.tar.bz2
opensim-SC_OLD-0a47a75b8894942e43a132c8479b1b17e7d4e8b5.tar.xz
* Send full inventory folder skeleton to standalone client logins rather than just the root child folders
* This may resolve some current problems with non root child folders on standalone installations. * A fix for the same problem in grid mode will come soon.
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs5
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs16
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs8
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs24
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs3
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs8
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs8
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs8
-rw-r--r--OpenSim/Framework/InventoryItemBase.cs8
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs4
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs3
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs8
12 files changed, 73 insertions, 30 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 077a61d..59e5b6e 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -31,6 +31,9 @@ namespace OpenSim.Framework.Communications.Cache
31{ 31{
32 public class CachedUserInfo 32 public class CachedUserInfo
33 { 33 {
34 private static readonly log4net.ILog m_log
35 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
36
34 private readonly CommunicationsManager m_parentCommsManager; 37 private readonly CommunicationsManager m_parentCommsManager;
35 // Fields 38 // Fields
36 public InventoryFolderImpl RootFolder = null; 39 public InventoryFolderImpl RootFolder = null;
@@ -44,6 +47,8 @@ namespace OpenSim.Framework.Communications.Cache
44 // Methods 47 // Methods
45 public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo) 48 public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo)
46 { 49 {
50 //m_log.DebugFormat("[INVENTORY CACHE]: Received folder {0} {1} for user {2}", folderInfo.name, folderInfo.folderID, userID);
51
47 if (userID == UserProfile.UUID) 52 if (userID == UserProfile.UUID)
48 { 53 {
49 if (RootFolder == null) 54 if (RootFolder == null)
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index fcfb53a..67022c7 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Cache
72 } 72 }
73 else 73 else
74 { 74 {
75 m_log.ErrorFormat("[USERCACHE]: User profile for user {0} not found", userID); 75 m_log.ErrorFormat("[USER CACHE]: User profile for user {0} not found", userID);
76 } 76 }
77 } 77 }
78 } 78 }
@@ -244,15 +244,14 @@ namespace OpenSim.Framework.Communications.Cache
244 } 244 }
245 else 245 else
246 { 246 {
247 m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name); 247 m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", remoteClient.Name);
248 248
249 return; 249 return;
250 } 250 }
251 } 251 }
252 else 252 else
253 { 253 {
254 m_log.ErrorFormat("[INVENTORYCACHE]: " + 254 m_log.ErrorFormat("[INVENTORY CACHE]: Could not find user profile for {0} for folder {1}",
255 "Could not find user profile for {0} for folder {1}",
256 remoteClient.Name, folderID); 255 remoteClient.Name, folderID);
257 256
258 return; 257 return;
@@ -260,8 +259,7 @@ namespace OpenSim.Framework.Communications.Cache
260 259
261 // If we've reached this point then we couldn't find the folder, even though the client thinks 260 // If we've reached this point then we couldn't find the folder, even though the client thinks
262 // it exists 261 // it exists
263 m_log.ErrorFormat("[INVENTORYCACHE]: " + 262 m_log.ErrorFormat("[INVENTORY CACHE]: Could not find folder {0} for user {1}",
264 "Could not find folder {0} for user {1}",
265 folderID, remoteClient.Name); 263 folderID, remoteClient.Name);
266 } 264 }
267 265
@@ -303,14 +301,14 @@ namespace OpenSim.Framework.Communications.Cache
303 } 301 }
304 else 302 else
305 { 303 {
306 m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", agentID.ToString()); 304 m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString());
307 305
308 return new List<InventoryItemBase>(); ; 306 return new List<InventoryItemBase>(); ;
309 } 307 }
310 } 308 }
311 else 309 else
312 { 310 {
313 m_log.ErrorFormat("[INVENTORYCACHE]: " + 311 m_log.ErrorFormat("[INVENTORY CACHE]: " +
314 "Could not find user profile for {0} for folder {1}", 312 "Could not find user profile for {0} for folder {1}",
315 agentID.ToString(), folderID); 313 agentID.ToString(), folderID);
316 return new List<InventoryItemBase>(); 314 return new List<InventoryItemBase>();
@@ -318,7 +316,7 @@ namespace OpenSim.Framework.Communications.Cache
318 316
319 // If we've reached this point then we couldn't find the folder, even though the client thinks 317 // If we've reached this point then we couldn't find the folder, even though the client thinks
320 // it exists 318 // it exists
321 m_log.ErrorFormat("[INVENTORYCACHE]: " + 319 m_log.ErrorFormat("[INVENTORY CACHE]: " +
322 "Could not find folder {0} for user {1}", 320 "Could not find folder {0} for user {1}",
323 folderID, agentID.ToString()); 321 folderID, agentID.ToString());
324 // } 322 // }
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index bb46777..d824e9d 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -87,6 +87,14 @@ namespace OpenSim.Framework.Communications
87 /// <param name="userID"></param> 87 /// <param name="userID"></param>
88 /// <returns></returns> 88 /// <returns></returns>
89 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID); 89 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID);
90
91 /// <summary>
92 /// Returns a list of all the folders in a given user's inventory.
93 /// </summary>
94 /// <param name="userId"></param>
95 /// <returns>A flat list of the user's inventory folder tree.
96 /// Null if there is no inventory for this user</returns>
97 List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
90 98
91 /// <summary> 99 /// <summary>
92 /// Returns the named folder in that users inventory, returns null if folder is not found. 100 /// Returns the named folder in that users inventory, returns null if folder is not found.
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 595fa65..d105069 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -108,6 +108,30 @@ namespace OpenSim.Framework.Communications
108 108
109 return inventoryList; 109 return inventoryList;
110 } 110 }
111
112 // See IInventoryServices
113 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
114 {
115// m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId);
116
117 List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
118
119 InventoryFolderBase rootFolder = RequestRootFolder(userId);
120 userFolders.Add(rootFolder);
121
122 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
123 {
124 IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.folderID);
125 userFolders.AddRange(folders);
126 }
127
128// foreach (InventoryFolderBase folder in userFolders)
129// {
130// m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID);
131// }
132
133 return userFolders;
134 }
111 135
112 // See IInventoryServices 136 // See IInventoryServices
113 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) 137 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder)
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 5ba37e6..332583c 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -43,7 +43,8 @@ namespace OpenSim.Framework.UserManagement
43 /// </summary> 43 /// </summary>
44 public abstract class UserManagerBase : IUserService 44 public abstract class UserManagerBase : IUserService
45 { 45 {
46 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly log4net.ILog m_log
47 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
47 48
48 public UserConfig _config; 49 public UserConfig _config;
49 private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); 50 private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
index 03bde7e..1e99e51 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
@@ -652,12 +652,8 @@ namespace OpenSim.Framework.Data.MSSQL
652 folders.Add(f); 652 folders.Add(f);
653 } 653 }
654 654
655 /// <summary> 655 // See IInventoryData
656 /// Returns all child folders in the hierarchy from the parent folder and down 656 public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
657 /// </summary>
658 /// <param name="parentID">The folder to get subfolders for</param>
659 /// <returns>A list of inventory folders</returns>
660 protected List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
661 { 657 {
662 List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); 658 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
663 getInventoryFolders(ref folders, parentID); 659 getInventoryFolders(ref folders, parentID);
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
index d6dabfe..4165d8f 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
@@ -573,12 +573,8 @@ namespace OpenSim.Framework.Data.MySQL
573 folders.Add(f); 573 folders.Add(f);
574 } 574 }
575 575
576 /// <summary> 576 // See IInventoryData
577 /// Returns all child folders in the hierarchy from the parent folder and down 577 public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
578 /// </summary>
579 /// <param name="parentID">The folder to get subfolders for</param>
580 /// <returns>A list of inventory folders</returns>
581 protected List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
582 { 578 {
583 List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); 579 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
584 getInventoryFolders(ref folders, parentID); 580 getInventoryFolders(ref folders, parentID);
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
index 14a3e1a..d31863f 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
@@ -319,12 +319,8 @@ namespace OpenSim.Framework.Data.SQLite
319 return folders; 319 return folders;
320 } 320 }
321 321
322 /// <summary> 322 // See IInventoryData
323 /// Returns all child folders in the hierarchy from the parent folder and down 323 public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
324 /// </summary>
325 /// <param name="parentID">The folder to get subfolders for</param>
326 /// <returns>A list of inventory folders</returns>
327 protected List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
328 { 324 {
329 List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); 325 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
330 getInventoryFolders(ref folders, Util.ToRawUuidString(parentID)); 326 getInventoryFolders(ref folders, Util.ToRawUuidString(parentID));
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index 897af7f..1d0246b 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -165,6 +165,14 @@ namespace OpenSim.Framework
165 /// </summary> 165 /// </summary>
166 /// <returns>A string containing the plugin version</returns> 166 /// <returns>A string containing the plugin version</returns>
167 string getVersion(); 167 string getVersion();
168
169 /// <summary>
170 /// Returns all child folders in the hierarchy from the parent folder and down.
171 /// Does not return the parent folder itself.
172 /// </summary>
173 /// <param name="parentID">The folder to get subfolders for</param>
174 /// <returns>A list of inventory folders</returns>
175 List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID);
168 176
169 /// <summary> 177 /// <summary>
170 /// Returns a list of inventory items contained within the specified folder 178 /// Returns a list of inventory items contained within the specified folder
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index f154cd8..fc5cc6c 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -42,7 +42,9 @@ namespace OpenSim.Region.Communications.Local
42 public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, 42 public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
43 InventoryItemInfo itemCallBack) 43 InventoryItemInfo itemCallBack)
44 { 44 {
45 List<InventoryFolderBase> folders = RequestFirstLevelFolders(userID); 45 //List<InventoryFolderBase> folders = RequestFirstLevelFolders(userID);
46 List<InventoryFolderBase> folders = GetInventorySkeleton(userID);
47
46 InventoryFolderImpl rootFolder = null; 48 InventoryFolderImpl rootFolder = null;
47 49
48 //need to make sure we send root folder first 50 //need to make sure we send root folder first
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 5af0077..6bb505d 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -215,7 +215,8 @@ namespace OpenSim.Region.Communications.Local
215 // See LoginService 215 // See LoginService
216 protected override InventoryData GetInventorySkeleton(LLUUID userID) 216 protected override InventoryData GetInventorySkeleton(LLUUID userID)
217 { 217 {
218 List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); 218 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
219 //List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID);
219 if (folders.Count > 0) 220 if (folders.Count > 0)
220 { 221 {
221 LLUUID rootID = LLUUID.Zero; 222 LLUUID rootID = LLUUID.Zero;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 3551172..e78fc1a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -216,6 +216,14 @@ namespace OpenSim.Region.Communications.OGS1
216 public void CreateNewUserInventory(LLUUID user) 216 public void CreateNewUserInventory(LLUUID user)
217 { 217 {
218 } 218 }
219
220 // See IInventoryServices
221 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
222 {
223 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: The GetInventorySkeleton() method here should never be called!");
224
225 return new List<InventoryFolderBase>();
226 }
219 227
220 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) 228 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
221 { 229 {