From 70d7c97e94a0bab80080009e9906977e9475d35f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 14 Aug 2009 09:57:18 -0700 Subject: [PATCH] Doing session lookup in the right way. --- .../Inventory/HGInventoryBroker.cs | 9 +++++---- .../Inventory/RemoteInventoryServiceConnector.cs | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index f0493f72a5..cb9a462eb1 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 8722e68d41..5992145e79 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; + } }