diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 8ad9df8..4c134db 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -411,13 +411,39 @@ namespace OpenSim.Services.HypergridService | |||
411 | 411 | ||
412 | if(!m_allowDuplicatePresences) | 412 | if(!m_allowDuplicatePresences) |
413 | { | 413 | { |
414 | //// TODO - Should also check Presence.UserID if RegionID == UUID.Zero, they are a ghost. Maybe. | ||
415 | //// NOTE - this is a person hypergridding in, or returning home, or just logging in and it's duplicating effort in OpenSim/Services/LLLoginService/LLLoginService.cs. | ||
414 | if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) | 416 | if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) |
415 | { | 417 | { |
416 | if(SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo)) | 418 | // Also check Presence.UserID if RegionID == UUID.Zero, they are a ghost. |
419 | // Ghosting might be caused by failure to call PresenceService.LogoutAgent() on logout / crash / failed login. | ||
420 | // Might also need to double check if they are out hypergridding. | ||
421 | |||
422 | bool success = false; | ||
423 | if (m_PresenceService != null) | ||
424 | { | ||
425 | PresenceInfo pi = m_PresenceService.GetAgentByUser(account.PrincipalID); | ||
426 | if (null != pi) | ||
427 | { | ||
428 | Dictionary<string, object> pid = pi.ToKeyValuePairs(); | ||
429 | if ((pid["RegionID"].ToString() == UUID.Zero.ToString()) && (0 != String.Compare(pid["SessionID"].ToString(), aCircuit.SessionID.ToString()))) | ||
430 | { | ||
431 | m_log.WarnFormat("[GATEKEEPER SERVICE]: Exorcising ghost avatar {0}, session {1}, new session {2}.", pid["UserID"], pid["SessionID"], aCircuit.SessionID); | ||
432 | m_log.WarnFormat("[GATEKEEPER SERVICE]: NOT REALLY."); | ||
433 | //// Don't do this until after more checking. | ||
434 | //// success = m_PresenceService.LogoutAgent(new UUID(pid["SessionID"].ToString())); | ||
435 | //// if (success) | ||
436 | //// m_log.WarnFormat("[GATEKEEPER SERVICE]: Ghost avatar exorcised {0}, session {1}, new session {2}.", pid["UserID"], pid["SessionID"], aCircuit.SessionID); | ||
437 | //// else | ||
438 | //// m_log.ErrorFormat("[GATEKEEPER SERVICE]: Ghost avatar not exorcised {0}, session {1}, new session {2}!", pid["UserID"], pid["SessionID"], aCircuit.SessionID); | ||
439 | } | ||
440 | } | ||
441 | } | ||
442 | if ((!success) && SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo)) | ||
417 | { | 443 | { |
418 | if(account != null) | 444 | if(account != null) |
419 | m_log.InfoFormat( | 445 | m_log.InfoFormat( |
420 | "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in", | 446 | "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in. This may be bogus if a ghost avatar was exorcised above.", |
421 | account.FirstName, account.LastName); | 447 | account.FirstName, account.LastName); |
422 | reason = "You appear to be already logged in on the destination grid " + | 448 | reason = "You appear to be already logged in on the destination grid " + |
423 | "Please wait a a minute or two and retry. " + | 449 | "Please wait a a minute or two and retry. " + |