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)
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;
}

View File

@ -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;
}
}