From 10e0df0a2d757fbdfe76b6c60d8939fd17c42451 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 1 Aug 2008 19:24:48 +0000
Subject: * 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
---
.../Cache/UserProfileCacheService.cs | 4 +++
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 29 ++++++----------------
2 files changed, 12 insertions(+), 21 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 5045c97..c4a6b31 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -65,6 +65,8 @@ namespace OpenSim.Framework.Communications.Cache
///
public void AddNewUser(IClientAPI remoteClient)
{
+ m_log.DebugFormat("[USER CACHE]: Adding user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId);
+
// Potential fix - Multithreading issue.
lock (m_userProfiles)
{
@@ -92,6 +94,8 @@ namespace OpenSim.Framework.Communications.Cache
///
public void AddNewUser(LLUUID userID)
{
+ m_log.DebugFormat("[USER CACHE]: Adding user profile for {0}", userID);
+
// Potential fix - Multithreading issue.
lock (m_userProfiles)
{
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index bb3d953..178d652 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1948,26 +1948,17 @@ namespace OpenSim.Region.Environment.Scenes
// 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
m_scene.RemoveCapsHandler(UUID);
- newpos = newpos + (vel);
-
- bool crossingToRemoteRegion = neighbourRegion.ExternalHostName != m_scene.RegionInfo.ExternalHostName;
- if (crossingToRemoteRegion)
+ newpos = newpos + (vel);
+
+ CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID);
+ if (userInfo != null)
{
- m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID);
+ userInfo.DropInventory();
}
else
{
- CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(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);
- }
- }
+ m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID);
+ }
bool crossingSuccessful =
m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
@@ -1995,11 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes
else
{
// 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);
}
}
--
cgit v1.1