diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 4cc6905..4d073b2 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Region.Framework; | |||
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Services.Connectors.Hypergrid; | ||
38 | 39 | ||
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using log4net; | 41 | using log4net; |
@@ -47,7 +48,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
47 | public UUID Id; | 48 | public UUID Id; |
48 | public string FirstName; | 49 | public string FirstName; |
49 | public string LastName; | 50 | public string LastName; |
50 | public string ProfileURL; | 51 | public string HomeURL; |
52 | public Dictionary<string, object> ServerURLs; | ||
51 | } | 53 | } |
52 | 54 | ||
53 | public class UserManagementModule : ISharedRegionModule, IUserManagement | 55 | public class UserManagementModule : ISharedRegionModule, IUserManagement |
@@ -141,6 +143,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
141 | 143 | ||
142 | void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) | 144 | void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) |
143 | { | 145 | { |
146 | m_log.DebugFormat("[XXX] HandleUUIDNameRequest {0}", uuid); | ||
144 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) | 147 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) |
145 | { | 148 | { |
146 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); | 149 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); |
@@ -210,6 +213,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
210 | 213 | ||
211 | public string GetUserName(UUID uuid) | 214 | public string GetUserName(UUID uuid) |
212 | { | 215 | { |
216 | m_log.DebugFormat("[XXX] GetUserName {0}", uuid); | ||
213 | string[] names = GetUserNames(uuid); | 217 | string[] names = GetUserNames(uuid); |
214 | if (names.Length == 2) | 218 | if (names.Length == 2) |
215 | { | 219 | { |
@@ -222,6 +226,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
222 | return "(hippos)"; | 226 | return "(hippos)"; |
223 | } | 227 | } |
224 | 228 | ||
229 | public string GetUserHomeURL(UUID userID) | ||
230 | { | ||
231 | if (m_UserCache.ContainsKey(userID)) | ||
232 | return m_UserCache[userID].HomeURL; | ||
233 | |||
234 | return string.Empty; | ||
235 | } | ||
236 | |||
237 | public string GetUserServerURL(UUID userID, string serverType) | ||
238 | { | ||
239 | if (m_UserCache.ContainsKey(userID)) | ||
240 | { | ||
241 | UserData userdata = m_UserCache[userID]; | ||
242 | if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) | ||
243 | return userdata.ServerURLs[serverType].ToString(); | ||
244 | |||
245 | if (userdata.HomeURL != string.Empty) | ||
246 | { | ||
247 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); | ||
248 | userdata.ServerURLs = uConn.GetServerURLs(userID); | ||
249 | if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) | ||
250 | return userdata.ServerURLs[serverType].ToString(); | ||
251 | } | ||
252 | } | ||
253 | |||
254 | return string.Empty; | ||
255 | } | ||
256 | |||
225 | public void AddUser(UUID id, string creatorData) | 257 | public void AddUser(UUID id, string creatorData) |
226 | { | 258 | { |
227 | if (m_UserCache.ContainsKey(id)) | 259 | if (m_UserCache.ContainsKey(id)) |
@@ -247,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
247 | string[] parts = creatorData.Split(';'); | 279 | string[] parts = creatorData.Split(';'); |
248 | if (parts.Length >= 1) | 280 | if (parts.Length >= 1) |
249 | { | 281 | { |
250 | user.ProfileURL = parts[0]; | 282 | user.HomeURL = parts[0]; |
251 | try | 283 | try |
252 | { | 284 | { |
253 | Uri uri = new Uri(parts[0]); | 285 | Uri uri = new Uri(parts[0]); |
@@ -272,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
272 | lock (m_UserCache) | 304 | lock (m_UserCache) |
273 | m_UserCache[id] = user; | 305 | m_UserCache[id] = user; |
274 | 306 | ||
275 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | 307 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL); |
276 | } | 308 | } |
277 | 309 | ||
278 | public void AddUser(UUID uuid, string first, string last, string profileURL) | 310 | public void AddUser(UUID uuid, string first, string last, string profileURL) |