* correct bug from last commit - for now don't drop cached user profile when an agent is downgraded to a child agent

* since upgrading to a root agent doesn't currently re-retrieve the user profile
0.6.0-stable
Justin Clarke Casey 2008-08-01 19:24:48 +00:00
parent 43b2ff1d11
commit 10e0df0a2d
2 changed files with 12 additions and 21 deletions

View File

@ -65,6 +65,8 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="userID"></param> /// <param name="userID"></param>
public void AddNewUser(IClientAPI remoteClient) public void AddNewUser(IClientAPI remoteClient)
{ {
m_log.DebugFormat("[USER CACHE]: Adding user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId);
// Potential fix - Multithreading issue. // Potential fix - Multithreading issue.
lock (m_userProfiles) lock (m_userProfiles)
{ {
@ -92,6 +94,8 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="userID"></param> /// <param name="userID"></param>
public void AddNewUser(LLUUID userID) public void AddNewUser(LLUUID userID)
{ {
m_log.DebugFormat("[USER CACHE]: Adding user profile for {0}", userID);
// Potential fix - Multithreading issue. // Potential fix - Multithreading issue.
lock (m_userProfiles) lock (m_userProfiles)
{ {

View File

@ -1948,26 +1948,17 @@ namespace OpenSim.Region.Environment.Scenes
// This means we need to remove the current caps handler here and possibly compensate later, // This means we need to remove the current caps handler here and possibly compensate later,
// in case both scenes are being hosted on the same region server. Messy // in case both scenes are being hosted on the same region server. Messy
m_scene.RemoveCapsHandler(UUID); m_scene.RemoveCapsHandler(UUID);
newpos = newpos + (vel); newpos = newpos + (vel);
bool crossingToRemoteRegion = neighbourRegion.ExternalHostName != m_scene.RegionInfo.ExternalHostName; CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID);
if (crossingToRemoteRegion) if (userInfo != null)
{ {
m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID); userInfo.DropInventory();
} }
else else
{ {
CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID);
}
if (userInfo != null)
{
userInfo.DropInventory();
}
else
{
m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID);
}
}
bool crossingSuccessful = bool crossingSuccessful =
m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
@ -1995,11 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes
else else
{ {
// Restore the user structures that we needed to delete before asking the receiving region to complete the crossing // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing
if (crossingToRemoteRegion) m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID);
m_scene.CommsManager.UserProfileCacheService.AddNewUser(m_controllingClient);
m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID);
m_scene.AddCapsHandler(UUID); m_scene.AddCapsHandler(UUID);
} }
} }