From 7aa54593e0b6672979feec97b8151ed134388723 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 12 Aug 2009 20:39:48 -0700 Subject: Redirected all calls to CachedUserProfile methods to the inventory service. Redirection of the RootFolder property is still todo. This compiles but probably inventory will be inconsistent. --- .../Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 551a7eb..49c0083 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory Dictionary folders = m_Connector.GetSystemFolders(presence.UUID); m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); + if (folders.Count > 0) lock (m_InventoryCache) m_InventoryCache.Add(presence.UUID, folders); -- cgit v1.1 From 5246dc33dcfc51b7ebb19b269159df3991029350 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Aug 2009 14:10:12 -0700 Subject: Renamed QueryItem/QueryFolder to GetItem/GetFolder. The word 'query' starting to get on my nerves. --- .../ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | 4 ++-- .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 8 ++++---- .../Inventory/LocalInventoryServiceConnector.cs | 8 ++++---- .../Inventory/RemoteInventoryServiceConnector.cs | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index 375faf5..0526bc4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs @@ -184,9 +184,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// true if the item was successfully deleted public abstract bool DeleteItem(InventoryItemBase item); - public abstract InventoryItemBase QueryItem(InventoryItemBase item); + public abstract InventoryItemBase GetItem(InventoryItemBase item); - public abstract InventoryFolderBase QueryFolder(InventoryFolderBase folder); + public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder); /// /// Does the given user have an inventory structure? diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 62b9bed..db4e7f4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -387,13 +387,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory } } - public override InventoryItemBase QueryItem(InventoryItemBase item) + public override InventoryItemBase GetItem(InventoryItemBase item) { if (item == null) return null; if (IsLocalGridUser(item.Owner)) - return m_GridService.QueryItem(item); + return m_GridService.GetItem(item); else { UUID sessionID = GetSessionID(item.Owner); @@ -402,13 +402,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory } } - public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) + public override InventoryFolderBase GetFolder(InventoryFolderBase folder) { if (folder == null) return null; if (IsLocalGridUser(folder.Owner)) - return m_GridService.QueryFolder(folder); + return m_GridService.GetFolder(folder); else { UUID sessionID = GetSessionID(folder.Owner); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 6efe903..ccf06d1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -292,14 +292,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_InventoryService.DeleteItem(item); } - public override InventoryItemBase QueryItem(InventoryItemBase item) + public override InventoryItemBase GetItem(InventoryItemBase item) { - return m_InventoryService.QueryItem(item); + return m_InventoryService.GetItem(item); } - public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) + public override InventoryFolderBase GetFolder(InventoryFolderBase folder) { - return m_InventoryService.QueryFolder(folder); + return m_InventoryService.GetFolder(folder); } /// diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index f87aab9..4f19573 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); } - public override InventoryItemBase QueryItem(InventoryItemBase item) + public override InventoryItemBase GetItem(InventoryItemBase item) { if (item == null) return null; @@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); } - public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) + public override InventoryFolderBase GetFolder(InventoryFolderBase folder) { if (folder == null) return null; -- cgit v1.1 From 034c9cf606373bfa9d3f8040cd787f789e0efbf2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Aug 2009 17:34:15 -0700 Subject: Added GetAssetPermissions. Few last bugs nixed. This is ready for testing. --- .../Inventory/BaseInventoryConnector.cs | 7 ++++++- .../Inventory/HGInventoryBroker.cs | 17 +++++++++++++---- .../Inventory/LocalInventoryServiceConnector.cs | 20 +++++++++++--------- .../Inventory/RemoteInventoryServiceConnector.cs | 10 ++++++---- 4 files changed, 36 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index 0526bc4..ef5ffe1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs @@ -82,7 +82,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// /// /// null if no root folder was found - public abstract InventoryFolderBase GetRootFolder(UUID userID); + public InventoryFolderBase GetRootFolder(UUID userID) + { + // Root folder is here as system type Folder. + return m_cache.GetFolderForType(userID, AssetType.Folder); + } public abstract Dictionary GetSystemFolders(UUID userID); @@ -202,5 +206,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// public abstract List GetActiveGestures(UUID userId); + public abstract int GetAssetPermissions(UUID userID, UUID assetID); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index db4e7f4..fd12a57 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -263,6 +263,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory folders[(AssetType)folder.Type] = folder; } m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); + // Put the root folder there, as type Folder + folders[AssetType.Folder] = root; return folders; } m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); @@ -422,14 +424,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return false; } - public override InventoryFolderBase GetRootFolder(UUID userID) + public override List GetActiveGestures(UUID userId) { - return null; + return new List(); } - public override List GetActiveGestures(UUID userId) + public override int GetAssetPermissions(UUID userID, UUID assetID) { - return new List(); + if (IsLocalGridUser(userID)) + return m_GridService.GetAssetPermissions(userID, assetID); + else + { + UUID sessionID = GetSessionID(userID); + string uri = GetUserInventoryURI(userID) + "/" + userID.ToString(); + return m_HGService.GetAssetPermissions(uri, assetID, sessionID); + } } #endregion diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ccf06d1..2fbc5fe 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -201,8 +201,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 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 folders; } } @@ -312,19 +319,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_InventoryService.HasInventoryForUser(userID); } - /// - /// Retrieve the root inventory folder for the given user. - /// - /// - /// null if no root folder was found - public override InventoryFolderBase GetRootFolder(UUID userID) + public override List GetActiveGestures(UUID userId) { - return m_InventoryService.GetRootFolder(userID); + return m_InventoryService.GetActiveGestures(userId); } - public override List GetActiveGestures(UUID userId) + public override int GetAssetPermissions(UUID userID, UUID assetID) { - return m_InventoryService.GetActiveGestures(userId); + return m_InventoryService.GetAssetPermissions(userID, assetID); } #endregion IInventoryService } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 4f19573..e4bb865 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -296,16 +296,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return false; } - public override InventoryFolderBase GetRootFolder(UUID userID) + public override List GetActiveGestures(UUID userId) { - return null; + return new List(); } - public override List GetActiveGestures(UUID userId) + public override int GetAssetPermissions(UUID userID, UUID assetID) { - return new List(); + UUID sessionID = GetSessionID(userID); + return m_RemoteConnector.GetAssetPermissions(userID.ToString(), assetID, sessionID); } + #endregion private UUID GetSessionID(UUID userID) -- cgit v1.1 From 332d1b5f2f7684de7e359be17f929f85fe4dbe2c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 08:43:46 -0700 Subject: Additional debug messages, and bug fix in RemoteInventoryServiceConnector.cs, where the scene reference wasn't being set. --- .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 11 ++++++++++- .../Inventory/RemoteInventoryServiceConnector.cs | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index fd12a57..f0493f7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -455,15 +455,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private bool IsLocalGridUser(UUID userID) { if (m_UserProfileService == null) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile service. Returning false."); return false; + } CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); if (uinfo == null) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile for user {0}. Returning false.", userID); return true; + } string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); + string uri = m_LocalGridInventoryURI.TrimEnd('/'); + + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri); - if ((userInventoryServerURI == m_LocalGridInventoryURI) || (userInventoryServerURI == "")) + if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) { return true; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index e4bb865..8722e68 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -104,12 +104,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { + m_Scene = scene; + if (!m_Enabled) return; if (!m_Initialized) { - m_Scene = scene; // ugh! scene.CommsManager.UserProfileCacheService.SetInventoryService(this); scene.CommsManager.UserService.SetInventoryService(this); -- cgit v1.1 From 70d7c97e94a0bab80080009e9906977e9475d35f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 09:57:18 -0700 Subject: Doing session lookup in the right way. --- .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 9 +++++---- .../Inventory/RemoteInventoryServiceConnector.cs | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index f0493f7..cb9a462 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -393,7 +393,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if (item == null) return null; - + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetItem {0} for user {1}", item.ID, item.Owner); if (IsLocalGridUser(item.Owner)) return m_GridService.GetItem(item); else @@ -445,10 +445,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { - ScenePresence sp = m_Scene.GetScenePresence(userID); - if (sp != null) - return sp.ControllingClient.SessionId; + CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); + if (uinfo != null) + return uinfo.SessionID; + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user profile for {0} not found", userID); return UUID.Zero; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 8722e68..5992145 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -32,6 +32,7 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Statistics; +using OpenSim.Framework.Communications.Cache; using OpenSim.Services.Connectors; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -313,11 +314,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { - ScenePresence sp = m_Scene.GetScenePresence(userID); - if (sp != null) - return sp.ControllingClient.SessionId; - + CachedUserInfo uinfo = m_Scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); + if (uinfo != null) + return uinfo.SessionID; + m_log.DebugFormat("[INVENTORY CONNECTOR]: user profile for {0} not found", userID); return UUID.Zero; + } } -- cgit v1.1 From c56e51a6e36a7a9977b9b162349256b338f4e3f3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 10:29:29 -0700 Subject: More debug messages. --- .../Inventory/RemoteInventoryServiceConnector.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 5992145..20cddcd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -105,6 +105,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { + m_log.Debug("[XXXX] Adding scene " + scene.RegionInfo.RegionName); m_Scene = scene; if (!m_Enabled) @@ -314,6 +315,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { + if (m_Scene == null) + m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); + + if (m_Scene.CommsManager.UserProfileCacheService == null) + m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); + CachedUserInfo uinfo = m_Scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); if (uinfo != null) return uinfo.SessionID; -- cgit v1.1 From bb513c1d885284d7cc1d97ea2cc4fb834b8bada1 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 11:32:25 -0700 Subject: Changed the way to get to the profile service. Changed GetSystemsFolder in HGBroker. --- .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 16 ++++++++++++++-- .../Inventory/RemoteInventoryServiceConnector.cs | 8 +++++--- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index cb9a462..59b2019 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -238,7 +238,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public override Dictionary GetSystemFolders(UUID userID) { if (IsLocalGridUser(userID)) - return GetSystemFoldersLocal(userID); + { + // This is not pretty, but it will have to do for now + if (m_GridService is BaseInventoryConnector) + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetSystemsFolders redirected to RemoteInventoryServiceConnector module"); + return ((BaseInventoryConnector)m_GridService).GetSystemFolders(userID); + } + else + { + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetSystemsFolders redirected to GetSystemFoldersLocal"); + return GetSystemFoldersLocal(userID); + } + } else { UUID sessionID = GetSessionID(userID); @@ -464,7 +476,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); if (uinfo == null) { - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile for user {0}. Returning false.", userID); + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile for user {0}. Returning true.", userID); return true; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 20cddcd..62df3bd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -49,6 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private bool m_Enabled = false; private bool m_Initialized = false; private Scene m_Scene; + private UserProfileCacheService m_UserProfileService; private InventoryServicesConnector m_RemoteConnector; public Type ReplaceableInterface @@ -105,8 +106,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { - m_log.Debug("[XXXX] Adding scene " + scene.RegionInfo.RegionName); m_Scene = scene; + m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); if (!m_Enabled) return; @@ -133,6 +134,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void RegionLoaded(Scene scene) { + m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; if (!m_Enabled) return; @@ -318,10 +320,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (m_Scene == null) m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); - if (m_Scene.CommsManager.UserProfileCacheService == null) + if (m_UserProfileService == null) m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); - CachedUserInfo uinfo = m_Scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); + CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); if (uinfo != null) return uinfo.SessionID; m_log.DebugFormat("[INVENTORY CONNECTOR]: user profile for {0} not found", userID); -- cgit v1.1 From 46116864b9f8cc63ec97b89f11bb5372f08dbc01 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 11:50:42 -0700 Subject: Returning UUID.Zero is scene and user profile service are null in GetSession. This doesn't fix the underlying problem of these things being null -- they shouldn't be. --- .../Inventory/RemoteInventoryServiceConnector.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 62df3bd..bef716b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -135,6 +135,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void RegionLoaded(Scene scene) { m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; + if (m_UserProfileService != null) + m_log.Debug("[XXXX] Set m_UserProfileService in " + m_Scene.RegionInfo.RegionName); + if (!m_Enabled) return; @@ -318,10 +321,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { if (m_Scene == null) + { m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); + } if (m_UserProfileService == null) + { m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); + return UUID.Zero; + } CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); if (uinfo != null) -- cgit v1.1