* 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

@ -1950,15 +1950,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.RemoveCapsHandler(UUID); m_scene.RemoveCapsHandler(UUID);
newpos = newpos + (vel); newpos = newpos + (vel);
bool crossingToRemoteRegion = neighbourRegion.ExternalHostName != m_scene.RegionInfo.ExternalHostName;
if (crossingToRemoteRegion)
{
m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID);
}
else
{
CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID);
if (userInfo != null) if (userInfo != null)
{ {
userInfo.DropInventory(); userInfo.DropInventory();
@ -1967,7 +1959,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); 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.AddNewUser(m_controllingClient);
m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID);
m_scene.AddCapsHandler(UUID); m_scene.AddCapsHandler(UUID);
} }
} }