From 1302ef44e3c632159378bc4042c753bcf36e9c63 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 24 Sep 2007 07:30:30 +0000 Subject: * Started major restructusing of comms to prepare for better grid and region functionality * Working towards one shared set of services * Killed off two projects with very little functionality --- .../InventoryServiceBase/InventoryServiceBase.cs | 204 --------------------- 1 file changed, 204 deletions(-) delete mode 100644 OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs (limited to 'OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs') diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs deleted file mode 100644 index d76fac5..0000000 --- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using libsecondlife; -using OpenSim.Framework.Console; -using OpenSim.Framework.Data; - -namespace OpenSim.Framework.InventoryServiceBase -{ - public class InventoryServiceBase - { - protected Dictionary m_plugins = new Dictionary(); - //protected IAssetServer m_assetServer; - - public InventoryServiceBase() - { - //m_assetServer = assetServer; - } - - /// - /// Adds a new user server plugin - plugins will be requested in the order they were loaded. - /// - /// The filename to the user server plugin DLL - public void AddPlugin(string FileName) - { - if (!String.IsNullOrEmpty(FileName)) - { - MainLog.Instance.Verbose("Inventory", "Inventorystorage: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IInventoryData", true); - - if (typeInterface != null) - { - IInventoryData plug = - (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this.m_plugins.Add(plug.getName(), plug); - MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface"); - } - } - } - } - } - - /// - /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) - /// - /// - /// - public List RequestFirstLevelFolders(LLUUID userID) - { - List inventoryList = new List(); - foreach (KeyValuePair plugin in m_plugins) - { - InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID); - if (rootFolder != null) - { - inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); - inventoryList.Insert(0, rootFolder); - return inventoryList; - } - } - return inventoryList; - } - - /// - /// - /// - public InventoryFolderBase RequestUsersRoot(LLUUID userID) - { - foreach (KeyValuePair plugin in m_plugins) - { - return plugin.Value.getUserRootFolder(userID); - } - return null; - } - - /// - /// - /// - /// - /// - public List RequestSubFolders(LLUUID parentFolderID) - { - List inventoryList = new List(); - foreach (KeyValuePair plugin in m_plugins) - { - return plugin.Value.getInventoryFolders(parentFolderID); - } - return inventoryList; - } - - public List RequestFolderItems(LLUUID folderID) - { - List itemsList = new List(); - foreach (KeyValuePair plugin in m_plugins) - { - itemsList = plugin.Value.getInventoryInFolder(folderID); - return itemsList; - } - return itemsList; - } - - public void AddFolder(InventoryFolderBase folder) - { - foreach (KeyValuePair plugin in m_plugins) - { - plugin.Value.addInventoryFolder(folder); - } - } - - public void AddItem(InventoryItemBase item) - { - foreach (KeyValuePair plugin in m_plugins) - { - plugin.Value.addInventoryItem(item); - } - } - - public void deleteItem(InventoryItemBase item) - { - foreach (KeyValuePair plugin in m_plugins) - { - plugin.Value.deleteInventoryItem(item); - } - } - - /// - /// - /// - /// - public void AddNewInventorySet(UsersInventory inventory) - { - foreach (InventoryFolderBase folder in inventory.Folders.Values) - { - this.AddFolder(folder); - } - } - - public void CreateNewUserInventory(LLUUID user) - { - UsersInventory inven = new UsersInventory(); - inven.CreateNewInventorySet(user); - this.AddNewInventorySet(inven); - } - - public class UsersInventory - { - public Dictionary Folders = new Dictionary(); - public Dictionary Items = new Dictionary(); - - public UsersInventory() - { - - } - - public virtual void CreateNewInventorySet(LLUUID user) - { - InventoryFolderBase folder = new InventoryFolderBase(); - folder.parentID = LLUUID.Zero; - folder.agentID = user; - folder.folderID = LLUUID.Random(); - folder.name = "My Inventory"; - folder.type = 8; - folder.version = 1; - Folders.Add(folder.folderID, folder); - - LLUUID rootFolder = folder.folderID; - - folder = new InventoryFolderBase(); - folder.parentID = rootFolder; - folder.agentID = user; - folder.folderID = LLUUID.Random(); - folder.name = "Textures"; - folder.type = 0; - folder.version = 1; - Folders.Add(folder.folderID, folder); - - folder = new InventoryFolderBase(); - folder.parentID = rootFolder; - folder.agentID = user; - folder.folderID = LLUUID.Random(); - folder.name = "Objects"; - folder.type = 6; - folder.version = 1; - Folders.Add(folder.folderID, folder); - - folder = new InventoryFolderBase(); - folder.parentID = rootFolder; - folder.agentID = user; - folder.folderID = LLUUID.Random(); - folder.name = "Clothes"; - folder.type = 5; - folder.version = 1; - Folders.Add(folder.folderID, folder); - } - } - } -} \ No newline at end of file -- cgit v1.1