diff options
author | Justin Clarke Casey | 2008-08-01 19:24:48 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-08-01 19:24:48 +0000 |
commit | 10e0df0a2d757fbdfe76b6c60d8939fd17c42451 (patch) | |
tree | cb814f714fd643869f1e776a08fd4cebd0b235f5 /OpenSim | |
parent | * Drop cached inventory from the local region when a user crosses out into a ... (diff) | |
download | opensim-SC_OLD-10e0df0a2d757fbdfe76b6c60d8939fd17c42451.zip opensim-SC_OLD-10e0df0a2d757fbdfe76b6c60d8939fd17c42451.tar.gz opensim-SC_OLD-10e0df0a2d757fbdfe76b6c60d8939fd17c42451.tar.bz2 opensim-SC_OLD-10e0df0a2d757fbdfe76b6c60d8939fd17c42451.tar.xz |
* 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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 29 |
2 files changed, 12 insertions, 21 deletions
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 | |||
65 | /// <param name="userID"></param> | 65 | /// <param name="userID"></param> |
66 | public void AddNewUser(IClientAPI remoteClient) | 66 | public void AddNewUser(IClientAPI remoteClient) |
67 | { | 67 | { |
68 | m_log.DebugFormat("[USER CACHE]: Adding user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); | ||
69 | |||
68 | // Potential fix - Multithreading issue. | 70 | // Potential fix - Multithreading issue. |
69 | lock (m_userProfiles) | 71 | lock (m_userProfiles) |
70 | { | 72 | { |
@@ -92,6 +94,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
92 | /// <param name="userID"></param> | 94 | /// <param name="userID"></param> |
93 | public void AddNewUser(LLUUID userID) | 95 | public void AddNewUser(LLUUID userID) |
94 | { | 96 | { |
97 | m_log.DebugFormat("[USER CACHE]: Adding user profile for {0}", userID); | ||
98 | |||
95 | // Potential fix - Multithreading issue. | 99 | // Potential fix - Multithreading issue. |
96 | lock (m_userProfiles) | 100 | lock (m_userProfiles) |
97 | { | 101 | { |
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 | |||
1948 | // This means we need to remove the current caps handler here and possibly compensate later, | 1948 | // This means we need to remove the current caps handler here and possibly compensate later, |
1949 | // in case both scenes are being hosted on the same region server. Messy | 1949 | // in case both scenes are being hosted on the same region server. Messy |
1950 | m_scene.RemoveCapsHandler(UUID); | 1950 | m_scene.RemoveCapsHandler(UUID); |
1951 | newpos = newpos + (vel); | 1951 | newpos = newpos + (vel); |
1952 | 1952 | ||
1953 | bool crossingToRemoteRegion = neighbourRegion.ExternalHostName != m_scene.RegionInfo.ExternalHostName; | 1953 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); |
1954 | if (crossingToRemoteRegion) | 1954 | if (userInfo != null) |
1955 | { | 1955 | { |
1956 | m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID); | 1956 | userInfo.DropInventory(); |
1957 | } | 1957 | } |
1958 | else | 1958 | else |
1959 | { | 1959 | { |
1960 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); | 1960 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); |
1961 | 1961 | } | |
1962 | if (userInfo != null) | ||
1963 | { | ||
1964 | userInfo.DropInventory(); | ||
1965 | } | ||
1966 | else | ||
1967 | { | ||
1968 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); | ||
1969 | } | ||
1970 | } | ||
1971 | 1962 | ||
1972 | bool crossingSuccessful = | 1963 | bool crossingSuccessful = |
1973 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1964 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
@@ -1995,11 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1995 | else | 1986 | else |
1996 | { | 1987 | { |
1997 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing | 1988 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing |
1998 | if (crossingToRemoteRegion) | 1989 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); |
1999 | m_scene.CommsManager.UserProfileCacheService.AddNewUser(m_controllingClient); | ||
2000 | |||
2001 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); | ||
2002 | |||
2003 | m_scene.AddCapsHandler(UUID); | 1990 | m_scene.AddCapsHandler(UUID); |
2004 | } | 1991 | } |
2005 | } | 1992 | } |