diff options
author | Diva Canto | 2010-01-09 09:09:32 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-09 09:09:32 -0800 |
commit | 25fdbd6cbcfc857c444042745d7d4fa8e495a982 (patch) | |
tree | d3b1479ca58d2348ba83b422dcfb5abb0bb58766 /OpenSim/Framework/Communications/Osp/OspResolver.cs | |
parent | A few more inches... Old friends things removed. Less references to UserProfi... (diff) | |
download | opensim-SC-25fdbd6cbcfc857c444042745d7d4fa8e495a982.zip opensim-SC-25fdbd6cbcfc857c444042745d7d4fa8e495a982.tar.gz opensim-SC-25fdbd6cbcfc857c444042745d7d4fa8e495a982.tar.bz2 opensim-SC-25fdbd6cbcfc857c444042745d7d4fa8e495a982.tar.xz |
Less refs to UserProfileCacheService. Compiles but likely doesn't run.
Diffstat (limited to 'OpenSim/Framework/Communications/Osp/OspResolver.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Osp/OspResolver.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Osp/OspResolver.cs b/OpenSim/Framework/Communications/Osp/OspResolver.cs index 4013896..14f813a 100644 --- a/OpenSim/Framework/Communications/Osp/OspResolver.cs +++ b/OpenSim/Framework/Communications/Osp/OspResolver.cs | |||
@@ -31,6 +31,7 @@ using log4net; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications.Cache; | 33 | using OpenSim.Framework.Communications.Cache; |
34 | using OpenSim.Services.Interfaces; | ||
34 | 35 | ||
35 | namespace OpenSim.Framework.Communications.Osp | 36 | namespace OpenSim.Framework.Communications.Osp |
36 | { | 37 | { |
@@ -55,11 +56,11 @@ namespace OpenSim.Framework.Communications.Osp | |||
55 | /// <param name="userId"></param> | 56 | /// <param name="userId"></param> |
56 | /// <param name="commsManager"></param> | 57 | /// <param name="commsManager"></param> |
57 | /// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns> | 58 | /// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns> |
58 | public static string MakeOspa(UUID userId, CommunicationsManager commsManager) | 59 | public static string MakeOspa(UUID userId, IUserAccountService userService) |
59 | { | 60 | { |
60 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); | 61 | UserAccount account = userService.GetUserAccount(UUID.Zero, userId); |
61 | if (userInfo != null) | 62 | if (account != null) |
62 | return MakeOspa(userInfo.UserProfile.FirstName, userInfo.UserProfile.SurName); | 63 | return MakeOspa(account.FirstName, account.LastName); |
63 | 64 | ||
64 | return null; | 65 | return null; |
65 | } | 66 | } |
@@ -88,7 +89,7 @@ namespace OpenSim.Framework.Communications.Osp | |||
88 | /// A suitable UUID for use in Second Life client communication. If the string was not a valid ospa, then UUID.Zero | 89 | /// A suitable UUID for use in Second Life client communication. If the string was not a valid ospa, then UUID.Zero |
89 | /// is returned. | 90 | /// is returned. |
90 | /// </returns> | 91 | /// </returns> |
91 | public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager) | 92 | public static UUID ResolveOspa(string ospa, IUserAccountService userService) |
92 | { | 93 | { |
93 | if (!ospa.StartsWith(OSPA_PREFIX)) | 94 | if (!ospa.StartsWith(OSPA_PREFIX)) |
94 | return UUID.Zero; | 95 | return UUID.Zero; |
@@ -112,7 +113,7 @@ namespace OpenSim.Framework.Communications.Osp | |||
112 | string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); | 113 | string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); |
113 | 114 | ||
114 | if (OSPA_NAME_KEY == key) | 115 | if (OSPA_NAME_KEY == key) |
115 | return ResolveOspaName(value, commsManager); | 116 | return ResolveOspaName(value, userService); |
116 | } | 117 | } |
117 | 118 | ||
118 | return UUID.Zero; | 119 | return UUID.Zero; |
@@ -137,7 +138,7 @@ namespace OpenSim.Framework.Communications.Osp | |||
137 | /// <returns> | 138 | /// <returns> |
138 | /// An OpenSim internal identifier for the name given. Returns null if the name was not valid | 139 | /// An OpenSim internal identifier for the name given. Returns null if the name was not valid |
139 | /// </returns> | 140 | /// </returns> |
140 | protected static UUID ResolveOspaName(string name, CommunicationsManager commsManager) | 141 | protected static UUID ResolveOspaName(string name, IUserAccountService userService) |
141 | { | 142 | { |
142 | int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); | 143 | int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); |
143 | 144 | ||
@@ -150,9 +151,9 @@ namespace OpenSim.Framework.Communications.Osp | |||
150 | string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); | 151 | string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); |
151 | string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); | 152 | string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); |
152 | 153 | ||
153 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); | 154 | UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName); |
154 | if (userInfo != null) | 155 | if (account != null) |
155 | return userInfo.UserProfile.ID; | 156 | return account.PrincipalID; |
156 | 157 | ||
157 | // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc | 158 | // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc |
158 | /* | 159 | /* |