mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
Try to cache system folders if they aren't already there when one is requested
This operation can be performed legitimately on standalones without a logged in user
This commit is contained in:
@@ -145,6 +145,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
m_InventoryCache.Remove(userID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the system folder for a particular asset type
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
Dictionary<AssetType, InventoryFolderBase> folders = null;
|
||||
@@ -152,6 +158,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
lock (m_InventoryCache)
|
||||
{
|
||||
m_InventoryCache.TryGetValue(userID, out folders);
|
||||
|
||||
// In some situations (such as non-secured standalones), system folders can be requested without
|
||||
// the user being logged in. So we need to try caching them here if we don't already have them.
|
||||
if (null == folders)
|
||||
CacheSystemFolders(userID);
|
||||
|
||||
m_InventoryCache.TryGetValue(userID, out folders);
|
||||
}
|
||||
|
||||
if ((folders != null) && folders.ContainsKey(type))
|
||||
|
||||
Reference in New Issue
Block a user