aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService/GatekeeperService.cs
diff options
context:
space:
mode:
authoronefang2019-08-15 02:18:35 +1000
committeronefang2019-08-15 02:18:35 +1000
commit7aecb3c7d9262b7dcd43b45736bb008a2f1ca742 (patch)
tree07678230038d535631906371a61cc1478f06cc26 /OpenSim/Services/HypergridService/GatekeeperService.cs
parentReload splash page every couple of minutes, to get fresh stats. (diff)
downloadopensim-SC_OLD-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.zip
opensim-SC_OLD-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.tar.gz
opensim-SC_OLD-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.tar.bz2
opensim-SC_OLD-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.tar.xz
Bandaid for ghost users, check and remove them from Presence when they log on.
Once again OOP proves it's worse that spaghetti, but cutting up the spaghetti and hiding it all over the kitchen. Note the commented out bits from GateKeeperService.cs, this stuff is checked TWICE, though this time is for HGers, or not.
Diffstat (limited to 'OpenSim/Services/HypergridService/GatekeeperService.cs')
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs30
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 5c6abd2..24979be 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -391,13 +391,39 @@ namespace OpenSim.Services.HypergridService
391 391
392 if(!m_allowDuplicatePresences) 392 if(!m_allowDuplicatePresences)
393 { 393 {
394//// TODO - Should also check Presence.UserID if RegionID == UUID.Zero, they are a ghost. Maybe.
395//// 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.
394 if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) 396 if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero)
395 { 397 {
396 if(SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo)) 398 // Also check Presence.UserID if RegionID == UUID.Zero, they are a ghost.
399 // Ghosting might be caused by failure to call PresenceService.LogoutAgent() on logout / crash / failed login.
400 // Might also need to double check if they are out hypergridding.
401
402 bool success = false;
403 if (m_PresenceService != null)
404 {
405 PresenceInfo pi = m_PresenceService.GetAgentByUser(account.PrincipalID);
406 if (null != pi)
407 {
408 Dictionary<string, object> pid = pi.ToKeyValuePairs();
409 if ((pid["RegionID"].ToString() == UUID.Zero.ToString()) && (0 != String.Compare(pid["SessionID"].ToString(), aCircuit.SessionID.ToString())))
410 {
411 m_log.WarnFormat("[GATEKEEPER SERVICE]: Exorcising ghost avatar {0}, session {1}, new session {2}.", pid["UserID"], pid["SessionID"], aCircuit.SessionID);
412m_log.WarnFormat("[GATEKEEPER SERVICE]: NOT REALLY.");
413//// Don't do this until after more checking.
414//// success = m_PresenceService.LogoutAgent(new UUID(pid["SessionID"].ToString()));
415//// if (success)
416//// m_log.WarnFormat("[GATEKEEPER SERVICE]: Ghost avatar exorcised {0}, session {1}, new session {2}.", pid["UserID"], pid["SessionID"], aCircuit.SessionID);
417//// else
418//// m_log.ErrorFormat("[GATEKEEPER SERVICE]: Ghost avatar not exorcised {0}, session {1}, new session {2}!", pid["UserID"], pid["SessionID"], aCircuit.SessionID);
419 }
420 }
421 }
422 if ((!success) && SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo))
397 { 423 {
398 if(account != null) 424 if(account != null)
399 m_log.InfoFormat( 425 m_log.InfoFormat(
400 "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in", 426 "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in. This may be bogus if a ghost avatar was exorcised above.",
401 account.FirstName, account.LastName); 427 account.FirstName, account.LastName);
402 reason = "You appear to be already logged in on the destination grid " + 428 reason = "You appear to be already logged in on the destination grid " +
403 "Please wait a a minute or two and retry. " + 429 "Please wait a a minute or two and retry. " +