diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Osp/OspResolver.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Osp/OspResolver.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Osp/OspResolver.cs b/OpenSim/Framework/Communications/Osp/OspResolver.cs index 4013896..2e55f53 100644 --- a/OpenSim/Framework/Communications/Osp/OspResolver.cs +++ b/OpenSim/Framework/Communications/Osp/OspResolver.cs | |||
@@ -30,7 +30,7 @@ using System.Text; | |||
30 | using log4net; | 30 | 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.Services.Interfaces; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Communications.Osp | 35 | namespace OpenSim.Framework.Communications.Osp |
36 | { | 36 | { |
@@ -55,11 +55,11 @@ namespace OpenSim.Framework.Communications.Osp | |||
55 | /// <param name="userId"></param> | 55 | /// <param name="userId"></param> |
56 | /// <param name="commsManager"></param> | 56 | /// <param name="commsManager"></param> |
57 | /// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns> | 57 | /// <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) | 58 | public static string MakeOspa(UUID userId, IUserAccountService userService) |
59 | { | 59 | { |
60 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); | 60 | UserAccount account = userService.GetUserAccount(UUID.Zero, userId); |
61 | if (userInfo != null) | 61 | if (account != null) |
62 | return MakeOspa(userInfo.UserProfile.FirstName, userInfo.UserProfile.SurName); | 62 | return MakeOspa(account.FirstName, account.LastName); |
63 | 63 | ||
64 | return null; | 64 | return null; |
65 | } | 65 | } |
@@ -88,7 +88,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 | 88 | /// A suitable UUID for use in Second Life client communication. If the string was not a valid ospa, then UUID.Zero |
89 | /// is returned. | 89 | /// is returned. |
90 | /// </returns> | 90 | /// </returns> |
91 | public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager) | 91 | public static UUID ResolveOspa(string ospa, IUserAccountService userService) |
92 | { | 92 | { |
93 | if (!ospa.StartsWith(OSPA_PREFIX)) | 93 | if (!ospa.StartsWith(OSPA_PREFIX)) |
94 | return UUID.Zero; | 94 | return UUID.Zero; |
@@ -112,7 +112,7 @@ namespace OpenSim.Framework.Communications.Osp | |||
112 | string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); | 112 | string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); |
113 | 113 | ||
114 | if (OSPA_NAME_KEY == key) | 114 | if (OSPA_NAME_KEY == key) |
115 | return ResolveOspaName(value, commsManager); | 115 | return ResolveOspaName(value, userService); |
116 | } | 116 | } |
117 | 117 | ||
118 | return UUID.Zero; | 118 | return UUID.Zero; |
@@ -137,7 +137,7 @@ namespace OpenSim.Framework.Communications.Osp | |||
137 | /// <returns> | 137 | /// <returns> |
138 | /// An OpenSim internal identifier for the name given. Returns null if the name was not valid | 138 | /// An OpenSim internal identifier for the name given. Returns null if the name was not valid |
139 | /// </returns> | 139 | /// </returns> |
140 | protected static UUID ResolveOspaName(string name, CommunicationsManager commsManager) | 140 | protected static UUID ResolveOspaName(string name, IUserAccountService userService) |
141 | { | 141 | { |
142 | int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); | 142 | int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); |
143 | 143 | ||
@@ -150,9 +150,9 @@ namespace OpenSim.Framework.Communications.Osp | |||
150 | string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); | 150 | string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); |
151 | string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); | 151 | string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); |
152 | 152 | ||
153 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); | 153 | UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName); |
154 | if (userInfo != null) | 154 | if (account != null) |
155 | return userInfo.UserProfile.ID; | 155 | return account.PrincipalID; |
156 | 156 | ||
157 | // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc | 157 | // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc |
158 | /* | 158 | /* |