From bd49985afa0a30cf9338730807a42eff3d508bee Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 2 May 2010 10:31:35 -0700 Subject: Switched everything to XInventory by default. The old Inventory is still there for now, in case bugs pop up with XInventory. --- .../Inventory/LocalInventoryServiceConnector.cs | 111 ++++++--------------- 1 file changed, 28 insertions(+), 83 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index a2f26d5..22bd04c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -41,7 +41,7 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { - public class LocalInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService + public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService { private static readonly ILog m_log = LogManager.GetLogger( @@ -50,7 +50,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private IInventoryService m_InventoryService; private bool m_Enabled = false; - private bool m_Initialized = false; public Type ReplaceableInterface { @@ -93,23 +92,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (m_InventoryService == null) { m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service"); - //return; throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); } - //List plugins - // = DataPluginFactory.LoadDataPlugins( - // configSettings.StandaloneInventoryPlugin, - // configSettings.StandaloneInventorySource); - - //foreach (IInventoryDataPlugin plugin in plugins) - //{ - // // Using the OSP wrapper plugin for database plugins should be made configurable at some point - // m_InventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); - //} - - Init(source); - m_Enabled = true; m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled"); } @@ -128,99 +113,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if (!m_Enabled) return; - - if (!m_Initialized) - { - m_Initialized = true; - } - -// m_log.DebugFormat( -// "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); - m_cache.AddRegion(scene); } public void RemoveRegion(Scene scene) { if (!m_Enabled) return; - - m_cache.RemoveRegion(scene); } public void RegionLoaded(Scene scene) { if (!m_Enabled) return; - - m_log.InfoFormat( - "[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName); } #region IInventoryService - public override bool CreateUserInventory(UUID user) + public bool CreateUserInventory(UUID user) { return m_InventoryService.CreateUserInventory(user); } - public override List GetInventorySkeleton(UUID userId) + public List GetInventorySkeleton(UUID userId) { return m_InventoryService.GetInventorySkeleton(userId); } - public override InventoryCollection GetUserInventory(UUID id) + public InventoryCollection GetUserInventory(UUID id) { return m_InventoryService.GetUserInventory(id); } - public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) + public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) { m_InventoryService.GetUserInventory(userID, callback); } - // Inherited. See base - //public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - //{ - // return m_InventoryService.GetFolderForType(userID, type); - //} - - public override Dictionary GetSystemFolders(UUID userID) + public InventoryFolderBase GetRootFolder(UUID userID) { - InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); - if (root != null) - { - InventoryCollection content = GetFolderContent(userID, root.ID); - if (content != null) - { - Dictionary folders = new Dictionary(); - foreach (InventoryFolderBase folder in content.Folders) - { - if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) - { - //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); - folders[(AssetType)folder.Type] = folder; - } - } - // Put the root folder there, as type Folder - folders[AssetType.Folder] = root; - //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); + return m_InventoryService.GetRootFolder(userID); + } - return folders; - } - } - m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID); - return new Dictionary(); + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + return m_InventoryService.GetFolderForType(userID, type); } - public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) { return m_InventoryService.GetFolderContent(userID, folderID); } - - public override List GetFolderItems(UUID userID, UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return m_InventoryService.GetFolderItems(userID, folderID); } @@ -230,7 +176,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully added - public override bool AddFolder(InventoryFolderBase folder) + public bool AddFolder(InventoryFolderBase folder) { return m_InventoryService.AddFolder(folder); } @@ -240,7 +186,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully updated - public override bool UpdateFolder(InventoryFolderBase folder) + public bool UpdateFolder(InventoryFolderBase folder) { return m_InventoryService.UpdateFolder(folder); } @@ -250,12 +196,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// A folder containing the details of the new location /// true if the folder was successfully moved - public override bool MoveFolder(InventoryFolderBase folder) + public bool MoveFolder(InventoryFolderBase folder) { return m_InventoryService.MoveFolder(folder); } - public override bool DeleteFolders(UUID ownerID, List folderIDs) + public bool DeleteFolders(UUID ownerID, List folderIDs) { return m_InventoryService.DeleteFolders(ownerID, folderIDs); } @@ -265,18 +211,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the folder was successfully purged - public override bool PurgeFolder(InventoryFolderBase folder) + public bool PurgeFolder(InventoryFolderBase folder) { return m_InventoryService.PurgeFolder(folder); } /// - /// Add a new item to the user's inventory, plain - /// Called by base class AddItem + /// Add a new item to the user's inventory /// /// /// true if the item was successfully added - protected override bool AddItemPlain(InventoryItemBase item) + public bool AddItem(InventoryItemBase item) { return m_InventoryService.AddItem(item); } @@ -286,13 +231,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the item was successfully updated - public override bool UpdateItem(InventoryItemBase item) + public bool UpdateItem(InventoryItemBase item) { return m_InventoryService.UpdateItem(item); } - public override bool MoveItems(UUID ownerID, List items) + public bool MoveItems(UUID ownerID, List items) { return m_InventoryService.MoveItems(ownerID, items); } @@ -302,12 +247,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// true if the item was successfully deleted - public override bool DeleteItems(UUID ownerID, List itemIDs) + public bool DeleteItems(UUID ownerID, List itemIDs) { return m_InventoryService.DeleteItems(ownerID, itemIDs); } - public override InventoryItemBase GetItem(InventoryItemBase item) + public InventoryItemBase GetItem(InventoryItemBase item) { // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); @@ -322,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return item; } - public override InventoryFolderBase GetFolder(InventoryFolderBase folder) + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return m_InventoryService.GetFolder(folder); } @@ -332,17 +277,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// - public override bool HasInventoryForUser(UUID userID) + public bool HasInventoryForUser(UUID userID) { return m_InventoryService.HasInventoryForUser(userID); } - public override List GetActiveGestures(UUID userId) + public List GetActiveGestures(UUID userId) { return m_InventoryService.GetActiveGestures(userId); } - public override int GetAssetPermissions(UUID userID, UUID assetID) + public int GetAssetPermissions(UUID userID, UUID assetID) { return m_InventoryService.GetAssetPermissions(userID, assetID); } -- cgit v1.1