aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/InventoryServiceBase
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/InventoryServiceBase')
-rw-r--r--OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs272
-rw-r--r--OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs70
2 files changed, 171 insertions, 171 deletions
diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
index 49e2e6f..9f681c2 100644
--- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
+++ b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs
@@ -1,136 +1,136 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Reflection; 3using System.Reflection;
4using System.Text; 4using System.Text;
5using libsecondlife; 5using libsecondlife;
6using OpenSim.Framework.Console; 6using OpenSim.Framework.Console;
7using OpenSim.Framework.Interfaces; 7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Data; 8using OpenSim.Framework.Data;
9 9
10namespace OpenSim.Framework.InventoryServiceBase 10namespace OpenSim.Framework.InventoryServiceBase
11{ 11{
12 public class InventoryServiceBase 12 public class InventoryServiceBase
13 { 13 {
14 protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); 14 protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>();
15 protected IAssetServer m_assetServer; 15 protected IAssetServer m_assetServer;
16 16
17 public InventoryServiceBase(IAssetServer assetServer) 17 public InventoryServiceBase(IAssetServer assetServer)
18 { 18 {
19 m_assetServer = assetServer; 19 m_assetServer = assetServer;
20 } 20 }
21 21
22 /// <summary> 22 /// <summary>
23 /// Adds a new user server plugin - plugins will be requested in the order they were loaded. 23 /// Adds a new user server plugin - plugins will be requested in the order they were loaded.
24 /// </summary> 24 /// </summary>
25 /// <param name="FileName">The filename to the user server plugin DLL</param> 25 /// <param name="FileName">The filename to the user server plugin DLL</param>
26 public void AddPlugin(string FileName) 26 public void AddPlugin(string FileName)
27 { 27 {
28 MainLog.Instance.Verbose("Inventorytorage: Attempting to load " + FileName); 28 MainLog.Instance.Verbose("Inventorytorage: Attempting to load " + FileName);
29 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 29 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
30 30
31 foreach (Type pluginType in pluginAssembly.GetTypes()) 31 foreach (Type pluginType in pluginAssembly.GetTypes())
32 { 32 {
33 if (!pluginType.IsAbstract) 33 if (!pluginType.IsAbstract)
34 { 34 {
35 Type typeInterface = pluginType.GetInterface("IInventoryData", true); 35 Type typeInterface = pluginType.GetInterface("IInventoryData", true);
36 36
37 if (typeInterface != null) 37 if (typeInterface != null)
38 { 38 {
39 IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 39 IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
40 plug.Initialise(); 40 plug.Initialise();
41 this.m_plugins.Add(plug.getName(), plug); 41 this.m_plugins.Add(plug.getName(), plug);
42 MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface"); 42 MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface");
43 } 43 }
44 44
45 typeInterface = null; 45 typeInterface = null;
46 } 46 }
47 } 47 }
48 48
49 pluginAssembly = null; 49 pluginAssembly = null;
50 } 50 }
51 51
52 /// <summary> 52 /// <summary>
53 /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) 53 /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree)
54 /// </summary> 54 /// </summary>
55 /// <param name="userID"></param> 55 /// <param name="userID"></param>
56 /// <returns></returns> 56 /// <returns></returns>
57 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) 57 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
58 { 58 {
59 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); 59 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
60 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 60 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
61 { 61 {
62 InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID); 62 InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID);
63 if (rootFolder != null) 63 if (rootFolder != null)
64 { 64 {
65 inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); 65 inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID);
66 inventoryList.Insert(0, rootFolder); 66 inventoryList.Insert(0, rootFolder);
67 return inventoryList; 67 return inventoryList;
68 } 68 }
69 } 69 }
70 return inventoryList; 70 return inventoryList;
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
74 /// 74 ///
75 /// </summary> 75 /// </summary>
76 public InventoryFolderBase RequestUsersRoot(LLUUID userID) 76 public InventoryFolderBase RequestUsersRoot(LLUUID userID)
77 { 77 {
78 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 78 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
79 { 79 {
80 return plugin.Value.getUserRootFolder(userID); 80 return plugin.Value.getUserRootFolder(userID);
81 } 81 }
82 return null; 82 return null;
83 } 83 }
84 84
85 /// <summary> 85 /// <summary>
86 /// 86 ///
87 /// </summary> 87 /// </summary>
88 /// <param name="parentFolderID"></param> 88 /// <param name="parentFolderID"></param>
89 /// <returns></returns> 89 /// <returns></returns>
90 public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) 90 public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID)
91 { 91 {
92 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); 92 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
93 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 93 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
94 { 94 {
95 return plugin.Value.getInventoryFolders(parentFolderID); 95 return plugin.Value.getInventoryFolders(parentFolderID);
96 } 96 }
97 return inventoryList; 97 return inventoryList;
98 } 98 }
99 99
100 public List<InventoryItemBase> RequestFolderItems(LLUUID folderID) 100 public List<InventoryItemBase> RequestFolderItems(LLUUID folderID)
101 { 101 {
102 List<InventoryItemBase> itemsList = new List<InventoryItemBase>(); 102 List<InventoryItemBase> itemsList = new List<InventoryItemBase>();
103 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 103 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
104 { 104 {
105 itemsList = plugin.Value.getInventoryInFolder(folderID); 105 itemsList = plugin.Value.getInventoryInFolder(folderID);
106 return itemsList; 106 return itemsList;
107 } 107 }
108 return itemsList; 108 return itemsList;
109 } 109 }
110 110
111 /// <summary> 111 /// <summary>
112 /// 112 ///
113 /// </summary> 113 /// </summary>
114 /// <param name="inventory"></param> 114 /// <param name="inventory"></param>
115 public void AddNewInventorySet(UsersInventory inventory) 115 public void AddNewInventorySet(UsersInventory inventory)
116 { 116 {
117 117
118 } 118 }
119 119
120 public class UsersInventory 120 public class UsersInventory
121 { 121 {
122 public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>(); 122 public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>();
123 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); 123 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
124 124
125 public UsersInventory() 125 public UsersInventory()
126 { 126 {
127 127
128 } 128 }
129 129
130 protected virtual void CreateNewInventorySet() 130 protected virtual void CreateNewInventorySet()
131 { 131 {
132 132
133 } 133 }
134 } 134 }
135 } 135 }
136} 136}
diff --git a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs b/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs
index 35cca07..daf20b2 100644
--- a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs
+++ b/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs
@@ -1,35 +1,35 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.CompilerServices; 2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4 4
5// General Information about an assembly is controlled through the following 5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 7// associated with an assembly.
8[assembly: AssemblyTitle("InventoryServiceBase")] 8[assembly: AssemblyTitle("InventoryServiceBase")]
9[assembly: AssemblyDescription("")] 9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")] 10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")] 11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("InventoryServiceBase")] 12[assembly: AssemblyProduct("InventoryServiceBase")]
13[assembly: AssemblyCopyright("Copyright © 2007")] 13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")] 14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")] 15[assembly: AssemblyCulture("")]
16 16
17// Setting ComVisible to false makes the types in this assembly not visible 17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from 18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type. 19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)] 20[assembly: ComVisible(false)]
21 21
22// The following GUID is for the ID of the typelib if this project is exposed to COM 22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("7e1fbd0b-4a25-4804-a01f-89b04eb5b349")] 23[assembly: Guid("7e1fbd0b-4a25-4804-a01f-89b04eb5b349")]
24 24
25// Version information for an assembly consists of the following four values: 25// Version information for an assembly consists of the following four values:
26// 26//
27// Major Version 27// Major Version
28// Minor Version 28// Minor Version
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32// You can specify all the values or you can default the Revision and Build Numbers 32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below: 33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")] 34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")] 35[assembly: AssemblyFileVersion("1.0.0.0")]