Doing session lookup in the right way.

arthursv
Diva Canto 2009-08-14 09:57:18 -07:00
parent 332d1b5f2f
commit 70d7c97e94
2 changed files with 11 additions and 8 deletions

View File

@ -393,7 +393,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{ {
if (item == null) if (item == null)
return null; return null;
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetItem {0} for user {1}", item.ID, item.Owner);
if (IsLocalGridUser(item.Owner)) if (IsLocalGridUser(item.Owner))
return m_GridService.GetItem(item); return m_GridService.GetItem(item);
else else
@ -445,10 +445,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private UUID GetSessionID(UUID userID) private UUID GetSessionID(UUID userID)
{ {
ScenePresence sp = m_Scene.GetScenePresence(userID); CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID);
if (sp != null) if (uinfo != null)
return sp.ControllingClient.SessionId; return uinfo.SessionID;
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user profile for {0} not found", userID);
return UUID.Zero; return UUID.Zero;
} }

View File

@ -32,6 +32,7 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Statistics; using OpenSim.Framework.Statistics;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Services.Connectors; using OpenSim.Services.Connectors;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
@ -313,11 +314,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private UUID GetSessionID(UUID userID) private UUID GetSessionID(UUID userID)
{ {
ScenePresence sp = m_Scene.GetScenePresence(userID); CachedUserInfo uinfo = m_Scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
if (sp != null) if (uinfo != null)
return sp.ControllingClient.SessionId; return uinfo.SessionID;
m_log.DebugFormat("[INVENTORY CONNECTOR]: user profile for {0} not found", userID);
return UUID.Zero; return UUID.Zero;
} }
} }