diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index f595b02..98e30ce 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | 41 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
43 | { | 43 | { |
44 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService | 44 | public class LocalInventoryServicesConnector : InventoryCache, ISharedRegionModule, IInventoryService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -108,6 +108,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
108 | // m_InventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); | 108 | // m_InventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); |
109 | //} | 109 | //} |
110 | 110 | ||
111 | Init(source); | ||
112 | |||
111 | m_Enabled = true; | 113 | m_Enabled = true; |
112 | m_log.Info("[INVENTORY CONNECTOR]: Local inventory connector enabled"); | 114 | m_log.Info("[INVENTORY CONNECTOR]: Local inventory connector enabled"); |
113 | } | 115 | } |
@@ -122,7 +124,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
122 | { | 124 | { |
123 | } | 125 | } |
124 | 126 | ||
125 | public void AddRegion(Scene scene) | 127 | public override void AddRegion(Scene scene) |
126 | { | 128 | { |
127 | if (!m_Enabled) | 129 | if (!m_Enabled) |
128 | return; | 130 | return; |
@@ -139,10 +141,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
139 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); | 141 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); |
140 | 142 | ||
141 | scene.RegisterModuleInterface<IInventoryService>(this); | 143 | scene.RegisterModuleInterface<IInventoryService>(this); |
144 | base.AddRegion(scene); | ||
142 | } | 145 | } |
143 | 146 | ||
144 | public void RemoveRegion(Scene scene) | 147 | public override void RemoveRegion(Scene scene) |
145 | { | 148 | { |
149 | base.RemoveRegion(scene); | ||
146 | } | 150 | } |
147 | 151 | ||
148 | public void RegionLoaded(Scene scene) | 152 | public void RegionLoaded(Scene scene) |
@@ -176,6 +180,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
176 | m_InventoryService.GetUserInventory(userID, callback); | 180 | m_InventoryService.GetUserInventory(userID, callback); |
177 | } | 181 | } |
178 | 182 | ||
183 | // Inherited. See base | ||
184 | //public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
185 | //{ | ||
186 | // return m_InventoryService.GetFolderForType(userID, type); | ||
187 | //} | ||
188 | |||
189 | public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
190 | { | ||
191 | InventoryFolderBase root = GetRootFolder(userID); | ||
192 | if (root != null) | ||
193 | { | ||
194 | InventoryCollection content = GetFolderContent(userID, root.ID); | ||
195 | if (content != null) | ||
196 | { | ||
197 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
198 | foreach (InventoryFolderBase folder in content.Folders) | ||
199 | { | ||
200 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
201 | folders[(AssetType)folder.Type] = folder; | ||
202 | } | ||
203 | return folders; | ||
204 | } | ||
205 | } | ||
206 | m_log.WarnFormat("[INVENTORY CONNECTOR]: System folders for {0} not found", userID); | ||
207 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
208 | } | ||
209 | |||
210 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | ||
211 | { | ||
212 | return m_InventoryService.GetFolderContent(userID, folderID); | ||
213 | } | ||
214 | |||
215 | |||
179 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 216 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
180 | { | 217 | { |
181 | return m_InventoryService.GetFolderItems(userID, folderID); | 218 | return m_InventoryService.GetFolderItems(userID, folderID); |
@@ -276,9 +313,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
276 | /// </summary> | 313 | /// </summary> |
277 | /// <param name="userID"></param> | 314 | /// <param name="userID"></param> |
278 | /// <returns>null if no root folder was found</returns> | 315 | /// <returns>null if no root folder was found</returns> |
279 | public InventoryFolderBase RequestRootFolder(UUID userID) | 316 | public InventoryFolderBase GetRootFolder(UUID userID) |
280 | { | 317 | { |
281 | return m_InventoryService.RequestRootFolder(userID); | 318 | return m_InventoryService.GetRootFolder(userID); |
282 | } | 319 | } |
283 | 320 | ||
284 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 321 | public List<InventoryItemBase> GetActiveGestures(UUID userId) |