From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- .../HypergridService/HGSuitcaseInventoryService.cs | 76 ++-------------------- 1 file changed, 7 insertions(+), 69 deletions(-) (limited to 'OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs') diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 784f136..6e4b68c 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -56,12 +56,10 @@ namespace OpenSim.Services.HypergridService private string m_HomeURL; private IUserAccountService m_UserAccountService; - private IAvatarService m_AvatarService; // private UserAccountCache m_Cache; private ExpiringCache> m_SuitcaseTrees = new ExpiringCache>(); - private ExpiringCache m_Appearances = new ExpiringCache(); public HGSuitcaseInventoryService(IConfigSource config, string configName) : base(config, configName) @@ -71,7 +69,7 @@ namespace OpenSim.Services.HypergridService m_ConfigName = configName; if (m_Database == null) - m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: m_Database is null!"); + m_log.WarnFormat("[XXX]: m_Database is null!"); // // Try reading the [InventoryService] section, if it exists @@ -79,6 +77,7 @@ namespace OpenSim.Services.HypergridService IConfig invConfig = config.Configs[m_ConfigName]; if (invConfig != null) { + // realm = authConfig.GetString("Realm", realm); string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty); if (userAccountsDll == string.Empty) throw new Exception("Please specify UserAccountsService in HGInventoryService configuration"); @@ -88,14 +87,8 @@ namespace OpenSim.Services.HypergridService if (m_UserAccountService == null) throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll)); - string avatarDll = invConfig.GetString("AvatarService", string.Empty); - if (avatarDll == string.Empty) - throw new Exception("Please specify AvatarService in HGInventoryService configuration"); - - m_AvatarService = ServerUtils.LoadPlugin(avatarDll, args); - if (m_AvatarService == null) - throw new Exception(String.Format("Unable to create m_AvatarService from {0}", avatarDll)); - + // legacy configuration [obsolete] + m_HomeURL = invConfig.GetString("ProfileServerURI", string.Empty); // Preferred m_HomeURL = invConfig.GetString("HomeURI", m_HomeURL); @@ -301,7 +294,7 @@ namespace OpenSim.Services.HypergridService public override bool AddFolder(InventoryFolderBase folder) { - //m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID); + m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID); // Let's do a bit of sanity checking, more than the base service does // make sure the given folder's parent folder exists under the suitcase tree of this user @@ -323,7 +316,7 @@ namespace OpenSim.Services.HypergridService public override bool UpdateFolder(InventoryFolderBase folder) { - //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); + m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) { m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name); @@ -401,7 +394,7 @@ namespace OpenSim.Services.HypergridService return null; } - if (!IsWithinSuitcaseTree(it.Owner, it.Folder) && !IsPartOfAppearance(it.Owner, it.ID)) + if (!IsWithinSuitcaseTree(it.Owner, it.Folder)) { m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0} (folder {1}) is not within Suitcase", it.Name, it.Folder); @@ -460,15 +453,6 @@ namespace OpenSim.Services.HypergridService if (folders != null && folders.Length > 0) return folders[0]; - - // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. - folders = m_Database.GetFolders( - new string[] { "agentID", "folderName", "parentFolderID" }, - new string[] { principalID.ToString(), "My Inventory", UUID.Zero.ToString() }); - - if (folders != null && folders.Length > 0) - return folders[0]; - return null; } @@ -565,52 +549,6 @@ namespace OpenSim.Services.HypergridService else return true; } #endregion - - #region Avatar Appearance - - private AvatarAppearance GetAppearance(UUID principalID) - { - AvatarAppearance a = null; - if (m_Appearances.TryGetValue(principalID, out a)) - return a; - - a = m_AvatarService.GetAppearance(principalID); - m_Appearances.AddOrUpdate(principalID, a, 5 * 60); // 5minutes - return a; - } - - private bool IsPartOfAppearance(UUID principalID, UUID itemID) - { - AvatarAppearance a = GetAppearance(principalID); - - if (a == null) - return false; - - // Check wearables (body parts and clothes) - for (int i = 0; i < a.Wearables.Length; i++) - { - for (int j = 0; j < a.Wearables[i].Count; j++) - { - if (a.Wearables[i][j].ItemID == itemID) - { - //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is a wearable", itemID); - return true; - } - } - } - - // Check attachments - if (a.GetAttachmentForItem(itemID) != null) - { - //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is an attachment", itemID); - return true; - } - - return false; - } - - #endregion - } } -- cgit v1.1