diff options
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginResponse.cs | 4 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 63 |
2 files changed, 35 insertions, 32 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 0cd8f5b..dc5ca51 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -220,7 +220,7 @@ namespace OpenSim.Services.LLLoginService | |||
220 | SetDefaultValues(); | 220 | SetDefaultValues(); |
221 | } | 221 | } |
222 | 222 | ||
223 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo, | 223 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, |
224 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, | 224 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, |
225 | string where, string startlocation, Vector3 position, Vector3 lookAt, string message, | 225 | string where, string startlocation, Vector3 position, Vector3 lookAt, string message, |
226 | GridRegion home, IPEndPoint clientIP) | 226 | GridRegion home, IPEndPoint clientIP) |
@@ -288,7 +288,7 @@ namespace OpenSim.Services.LLLoginService | |||
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | private void FillOutHomeData(PresenceInfo pinfo, GridRegion home) | 291 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) |
292 | { | 292 | { |
293 | int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; | 293 | int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; |
294 | if (home != null) | 294 | if (home != null) |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9efdd11..398fe4f 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Services.LLLoginService | |||
53 | private static bool Initialized = false; | 53 | private static bool Initialized = false; |
54 | 54 | ||
55 | protected IUserAccountService m_UserAccountService; | 55 | protected IUserAccountService m_UserAccountService; |
56 | protected IGridUserService m_GridUserService; | ||
56 | protected IAuthenticationService m_AuthenticationService; | 57 | protected IAuthenticationService m_AuthenticationService; |
57 | protected IInventoryService m_InventoryService; | 58 | protected IInventoryService m_InventoryService; |
58 | protected IGridService m_GridService; | 59 | protected IGridService m_GridService; |
@@ -82,6 +83,7 @@ namespace OpenSim.Services.LLLoginService | |||
82 | throw new Exception(String.Format("No section LoginService in config file")); | 83 | throw new Exception(String.Format("No section LoginService in config file")); |
83 | 84 | ||
84 | string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); | 85 | string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); |
86 | string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); | ||
85 | string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); | 87 | string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); |
86 | string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); | 88 | string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); |
87 | string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); | 89 | string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); |
@@ -105,8 +107,10 @@ namespace OpenSim.Services.LLLoginService | |||
105 | 107 | ||
106 | Object[] args = new Object[] { config }; | 108 | Object[] args = new Object[] { config }; |
107 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); | 109 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); |
110 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | ||
108 | m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); | 111 | m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); |
109 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); | 112 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); |
113 | |||
110 | if (gridService != string.Empty) | 114 | if (gridService != string.Empty) |
111 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 115 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
112 | if (presenceService != string.Empty) | 116 | if (presenceService != string.Empty) |
@@ -277,8 +281,6 @@ namespace OpenSim.Services.LLLoginService | |||
277 | // | 281 | // |
278 | // Login the presence | 282 | // Login the presence |
279 | // | 283 | // |
280 | PresenceInfo presence = null; | ||
281 | GridRegion home = null; | ||
282 | if (m_PresenceService != null) | 284 | if (m_PresenceService != null) |
283 | { | 285 | { |
284 | success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession); | 286 | success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession); |
@@ -287,28 +289,35 @@ namespace OpenSim.Services.LLLoginService | |||
287 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: could not login presence"); | 289 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: could not login presence"); |
288 | return LLFailedLoginResponse.GridProblem; | 290 | return LLFailedLoginResponse.GridProblem; |
289 | } | 291 | } |
290 | |||
291 | // Get the updated presence info | ||
292 | presence = m_PresenceService.GetAgent(session); | ||
293 | |||
294 | // Get the home region | ||
295 | if ((presence.HomeRegionID != UUID.Zero) && m_GridService != null) | ||
296 | { | ||
297 | home = m_GridService.GetRegionByUUID(scopeID, presence.HomeRegionID); | ||
298 | } | ||
299 | } | 292 | } |
300 | 293 | ||
301 | // | 294 | // |
295 | // Change Online status and get the home region | ||
296 | // | ||
297 | GridRegion home = null; | ||
298 | GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString()); | ||
299 | if (guinfo != null && (guinfo.HomeRegionID != UUID.Zero) && m_GridService != null) | ||
300 | { | ||
301 | home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID); | ||
302 | } | ||
303 | if (guinfo == null) | ||
304 | { | ||
305 | // something went wrong, make something up, so that we don't have to test this anywhere else | ||
306 | guinfo = new GridUserInfo(); | ||
307 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); | ||
308 | } | ||
309 | |||
310 | // | ||
302 | // Find the destination region/grid | 311 | // Find the destination region/grid |
303 | // | 312 | // |
304 | string where = string.Empty; | 313 | string where = string.Empty; |
305 | Vector3 position = Vector3.Zero; | 314 | Vector3 position = Vector3.Zero; |
306 | Vector3 lookAt = Vector3.Zero; | 315 | Vector3 lookAt = Vector3.Zero; |
307 | GridRegion gatekeeper = null; | 316 | GridRegion gatekeeper = null; |
308 | GridRegion destination = FindDestination(account, scopeID, presence, session, startLocation, out gatekeeper, out where, out position, out lookAt); | 317 | GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt); |
309 | if (destination == null) | 318 | if (destination == null) |
310 | { | 319 | { |
311 | m_PresenceService.LogoutAgent(session, presence.Position, presence.LookAt); | 320 | m_PresenceService.LogoutAgent(session); |
312 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: destination not found"); | 321 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: destination not found"); |
313 | return LLFailedLoginResponse.GridProblem; | 322 | return LLFailedLoginResponse.GridProblem; |
314 | } | 323 | } |
@@ -330,7 +339,7 @@ namespace OpenSim.Services.LLLoginService | |||
330 | 339 | ||
331 | if (aCircuit == null) | 340 | if (aCircuit == null) |
332 | { | 341 | { |
333 | m_PresenceService.LogoutAgent(session, presence.Position, presence.LookAt); | 342 | m_PresenceService.LogoutAgent(session); |
334 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason); | 343 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason); |
335 | return LLFailedLoginResponse.AuthorizationProblem; | 344 | return LLFailedLoginResponse.AuthorizationProblem; |
336 | 345 | ||
@@ -346,7 +355,7 @@ namespace OpenSim.Services.LLLoginService | |||
346 | // | 355 | // |
347 | // Finally, fill out the response and return it | 356 | // Finally, fill out the response and return it |
348 | // | 357 | // |
349 | LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, friendsList, m_LibraryService, | 358 | LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, |
350 | where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); | 359 | where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); |
351 | 360 | ||
352 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); | 361 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); |
@@ -356,12 +365,12 @@ namespace OpenSim.Services.LLLoginService | |||
356 | { | 365 | { |
357 | m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace); | 366 | m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace); |
358 | if (m_PresenceService != null) | 367 | if (m_PresenceService != null) |
359 | m_PresenceService.LogoutAgent(session, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | 368 | m_PresenceService.LogoutAgent(session); |
360 | return LLFailedLoginResponse.InternalError; | 369 | return LLFailedLoginResponse.InternalError; |
361 | } | 370 | } |
362 | } | 371 | } |
363 | 372 | ||
364 | protected GridRegion FindDestination(UserAccount account, UUID scopeID, PresenceInfo pinfo, UUID sessionID, string startLocation, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) | 373 | protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) |
365 | { | 374 | { |
366 | m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); | 375 | m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); |
367 | 376 | ||
@@ -383,7 +392,7 @@ namespace OpenSim.Services.LLLoginService | |||
383 | 392 | ||
384 | bool tryDefaults = false; | 393 | bool tryDefaults = false; |
385 | 394 | ||
386 | if (pinfo.HomeRegionID.Equals(UUID.Zero)) | 395 | if (home == null) |
387 | { | 396 | { |
388 | m_log.WarnFormat( | 397 | m_log.WarnFormat( |
389 | "[LLOGIN SERVICE]: User {0} {1} tried to login to a 'home' start location but they have none set", | 398 | "[LLOGIN SERVICE]: User {0} {1} tried to login to a 'home' start location but they have none set", |
@@ -393,16 +402,10 @@ namespace OpenSim.Services.LLLoginService | |||
393 | } | 402 | } |
394 | else | 403 | else |
395 | { | 404 | { |
396 | region = m_GridService.GetRegionByUUID(scopeID, pinfo.HomeRegionID); | 405 | region = home; |
397 | 406 | ||
398 | if (null == region) | 407 | position = pinfo.HomePosition; |
399 | { | 408 | lookAt = pinfo.HomeLookAt; |
400 | m_log.WarnFormat( | ||
401 | "[LLOGIN SERVICE]: User {0} {1} has a recorded home region of {2} but this cannot be found by the grid service", | ||
402 | account.FirstName, account.LastName, pinfo.HomeRegionID); | ||
403 | |||
404 | tryDefaults = true; | ||
405 | } | ||
406 | } | 409 | } |
407 | 410 | ||
408 | if (tryDefaults) | 411 | if (tryDefaults) |
@@ -438,7 +441,7 @@ namespace OpenSim.Services.LLLoginService | |||
438 | 441 | ||
439 | GridRegion region = null; | 442 | GridRegion region = null; |
440 | 443 | ||
441 | if (pinfo.RegionID.Equals(UUID.Zero) || (region = m_GridService.GetRegionByUUID(scopeID, pinfo.RegionID)) == null) | 444 | if (pinfo.LastRegionID.Equals(UUID.Zero) || (region = m_GridService.GetRegionByUUID(scopeID, pinfo.LastRegionID)) == null) |
442 | { | 445 | { |
443 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); | 446 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); |
444 | if (defaults != null && defaults.Count > 0) | 447 | if (defaults != null && defaults.Count > 0) |
@@ -460,8 +463,8 @@ namespace OpenSim.Services.LLLoginService | |||
460 | } | 463 | } |
461 | else | 464 | else |
462 | { | 465 | { |
463 | position = pinfo.Position; | 466 | position = pinfo.LastPosition; |
464 | lookAt = pinfo.LookAt; | 467 | lookAt = pinfo.LastLookAt; |
465 | } | 468 | } |
466 | 469 | ||
467 | return region; | 470 | return region; |