From bdb365015b67d5b9b8646c97fc41047bb16f6175 Mon Sep 17 00:00:00 2001
From: onefang
Date: Wed, 9 Sep 2020 20:24:55 +1000
Subject: Bandaid for ghost users, check and remove them from Presence when
 they log on.

Once again OOP proves it's worse that spaghetti, by 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.
---
 .../ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs | 7 ++++++-
 OpenSim/Region/Framework/Interfaces/IPresenceModule.cs            | 8 ++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs
index fdbe10a..19a31d4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs
@@ -123,6 +123,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
             return m_PresenceService.GetAgent(sessionID);
         }
 
+        public PresenceInfo GetAgentByUser(UUID userID)
+        {
+            return m_PresenceService.GetAgentByUser(userID);
+        }
+
         public PresenceInfo[] GetAgents(string[] userIDs)
         {
             // Don't bother potentially making a useless network call if we not going to ask for any users anyway.
@@ -134,4 +139,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
 
         #endregion
     }
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs b/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs
index fb5933c..398611c 100644
--- a/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IPresenceModule.cs
@@ -33,11 +33,19 @@ namespace OpenSim.Region.Framework.Interfaces
     {
         public string UserID;
         public UUID RegionID;
+        public UUID SessionID;
 
+        public PresenceInfo(string userID, UUID regionID, UUID sessionID)
+        {
+            UserID = userID;
+            RegionID = regionID;
+            SessionID = sessionID;
+        }
         public PresenceInfo(string userID, UUID regionID)
         {
             UserID = userID;
             RegionID = regionID;
+            SessionID = UUID.Zero;
         }
     }
 
-- 
cgit v1.1