29 using System.Collections.Generic;
33 using System.Reflection;
34 using OpenSim.Services.Base;
35 using OpenSim.Services.Interfaces;
36 using OpenSim.Services.InventoryService;
38 using OpenSim.Framework;
39 using OpenSim.Server.Base;
41 namespace OpenSim.Services.HypergridService
52 private static readonly ILog m_log =
54 MethodBase.GetCurrentMethod().DeclaringType);
56 private string m_HomeURL;
62 : base(config, configName)
64 m_log.Debug(
"[HGInventory Service]: Starting");
65 if (configName !=
string.Empty)
66 m_ConfigName = configName;
71 IConfig invConfig = config.Configs[m_ConfigName];
72 if (invConfig != null)
75 string userAccountsDll = invConfig.GetString(
"UserAccountsService", string.Empty);
76 if (userAccountsDll ==
string.Empty)
77 throw new Exception(
"Please specify UserAccountsService in HGInventoryService configuration");
79 Object[] args =
new Object[] { config };
81 if (m_UserAccountService == null)
82 throw new Exception(String.Format(
"Unable to create UserAccountService from {0}", userAccountsDll));
84 m_HomeURL = Util.GetConfigVarFromSections<
string>(config,
"HomeURI",
85 new string[] {
"Startup",
"Hypergrid", m_ConfigName }, String.Empty);
87 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
90 m_log.Debug(
"[HG INVENTORY SERVICE]: Starting...");
103 return new List<InventoryFolderBase>();
111 new string[] {
"agentID",
"folderName"},
112 new string[] { principalID.ToString(),
"My Suitcase" });
114 if (folders.Length > 0)
115 return ConvertToOpenSim(folders[0]);
118 XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (
int)FolderType.Suitcase,
"My Suitcase");
119 return ConvertToOpenSim(suitcase);
147 return GetRootFolder(principalID);
184 private List<InventoryFolderBase> GetDescendents(List<InventoryFolderBase> lst, UUID root)
186 List<InventoryFolderBase> direct = lst.FindAll(delegate(
InventoryFolderBase f) {
return f.ParentID == root; });
188 return new List<InventoryFolderBase>();
190 List<InventoryFolderBase> indirect =
new List<InventoryFolderBase>();
192 indirect.AddRange(GetDescendents(lst, f.
ID));
194 direct.AddRange(indirect);
302 if (user != null && it != null &&
string.IsNullOrEmpty(it.
CreatorData))
override bool DeleteFolders(UUID principalID, List< UUID > folderIDs)
Delete an item from the user's inventory
override InventoryItemBase GetItem(InventoryItemBase item)
Get an item, given by its UUID
override bool CreateUserInventory(UUID principalID)
Create the entire inventory for a given user
override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type)
Gets the user folder for the given folder-type
HGInventoryService(IConfigSource config, string configName)
override InventoryFolderBase GetRootFolder(UUID principalID)
Retrieve the root inventory folder for the given user.
Inventory Item - contains all the properties associated with an individual inventory piece...
Hypergrid inventory service. It serves the IInventoryService interface, but implements it in ways tha...
string CreatorData
Extended creator information of the form <profile url>="">;<name>
UUID ID
A UUID containing the ID for the inventory node itself
override List< InventoryFolderBase > GetInventorySkeleton(UUID principalID)
Gets the skeleton of the inventory – folders only
override InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderID)
Gets everything (folders and items) inside a folder
override bool PurgeFolder(InventoryFolderBase folder)
Purge an inventory folder of all its items and subfolders.
Used to serialize a whole inventory for transfer over the network.