diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/CommunicationsManager.cs | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2410f31..4bf9018 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -209,35 +209,24 @@ namespace OpenSim.Framework.Communications | |||
209 | 209 | ||
210 | private string[] doUUIDNameRequest(UUID uuid) | 210 | private string[] doUUIDNameRequest(UUID uuid) |
211 | { | 211 | { |
212 | string[] returnstring = new string[0]; | ||
213 | bool doLookup = false; | ||
214 | |||
215 | lock (m_nameRequestCache) | 212 | lock (m_nameRequestCache) |
216 | { | 213 | { |
217 | if (m_nameRequestCache.ContainsKey(uuid)) | 214 | if (m_nameRequestCache.ContainsKey(uuid)) |
218 | { | 215 | return m_nameRequestCache[uuid]; |
219 | returnstring = m_nameRequestCache[uuid]; | ||
220 | } | ||
221 | else | ||
222 | { | ||
223 | // we don't want to lock the dictionary while we're doing the lookup | ||
224 | doLookup = true; | ||
225 | } | ||
226 | } | 216 | } |
227 | 217 | ||
228 | if (doLookup) { | 218 | string[] returnstring = new string[0]; |
229 | UserProfileData profileData = m_userService.GetUserProfile(uuid); | 219 | CachedUserInfo uinfo = UserProfileCacheService.GetUserDetails(uuid); |
230 | if (profileData != null) | 220 | |
221 | if ((uinfo != null) && (uinfo.UserProfile != null)) | ||
222 | { | ||
223 | returnstring = new string[2]; | ||
224 | returnstring[0] = uinfo.UserProfile.FirstName; | ||
225 | returnstring[1] = uinfo.UserProfile.SurName; | ||
226 | lock (m_nameRequestCache) | ||
231 | { | 227 | { |
232 | returnstring = new string[2]; | 228 | if (!m_nameRequestCache.ContainsKey(uuid)) |
233 | // UUID profileId = profileData.ID; | 229 | m_nameRequestCache.Add(uuid, returnstring); |
234 | returnstring[0] = profileData.FirstName; | ||
235 | returnstring[1] = profileData.SurName; | ||
236 | lock (m_nameRequestCache) | ||
237 | { | ||
238 | if (!m_nameRequestCache.ContainsKey(uuid)) | ||
239 | m_nameRequestCache.Add(uuid, returnstring); | ||
240 | } | ||
241 | } | 230 | } |
242 | } | 231 | } |
243 | 232 | ||