aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authoronefang2019-08-15 02:18:35 +1000
committeronefang2019-08-15 02:18:35 +1000
commit7aecb3c7d9262b7dcd43b45736bb008a2f1ca742 (patch)
tree07678230038d535631906371a61cc1478f06cc26 /OpenSim/Data
parentReload splash page every couple of minutes, to get fresh stats. (diff)
downloadopensim-SC-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.zip
opensim-SC-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.tar.gz
opensim-SC-7aecb3c7d9262b7dcd43b45736bb008a2f1ca742.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Data/IPresenceData.cs1
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs13
-rw-r--r--OpenSim/Data/Null/NullPresenceData.cs13
-rw-r--r--OpenSim/Data/PGSQL/PGSQLPresenceData.cs10
4 files changed, 35 insertions, 2 deletions
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs
index 4086245..b026995 100644
--- a/OpenSim/Data/IPresenceData.cs
+++ b/OpenSim/Data/IPresenceData.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Data
49 bool Store(PresenceData data); 49 bool Store(PresenceData data);
50 50
51 PresenceData Get(UUID sessionID); 51 PresenceData Get(UUID sessionID);
52 PresenceData GetByUser(UUID userID);
52 void LogoutRegionAgents(UUID regionID); 53 void LogoutRegionAgents(UUID regionID);
53 bool ReportAgent(UUID sessionID, UUID regionID); 54 bool ReportAgent(UUID sessionID, UUID regionID);
54 PresenceData[] Get(string field, string data); 55 PresenceData[] Get(string field, string data);
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index 70aca5f..b9114eb 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -52,8 +52,17 @@ namespace OpenSim.Data.MySQL
52 52
53 public PresenceData Get(UUID sessionID) 53 public PresenceData Get(UUID sessionID)
54 { 54 {
55 PresenceData[] ret = Get("SessionID", 55 PresenceData[] ret = Get("SessionID", sessionID.ToString());
56 sessionID.ToString()); 56
57 if (ret.Length == 0)
58 return null;
59
60 return ret[0];
61 }
62
63 public PresenceData GetByUser(UUID userID)
64 {
65 PresenceData[] ret = Get("UserID", userID.ToString());
57 66
58 if (ret.Length == 0) 67 if (ret.Length == 0)
59 return null; 68 return null;
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs
index 8c442c9..ce1404e 100644
--- a/OpenSim/Data/Null/NullPresenceData.cs
+++ b/OpenSim/Data/Null/NullPresenceData.cs
@@ -79,6 +79,19 @@ namespace OpenSim.Data.Null
79 return null; 79 return null;
80 } 80 }
81 81
82 public PresenceData GetByUser(UUID userID)
83 {
84 if (Instance != this)
85 return Instance.GetByUser(userID);
86
87 if (m_presenceData.ContainsKey(userID))
88 {
89 return m_presenceData[userID];
90 }
91
92 return null;
93 }
94
82 public void LogoutRegionAgents(UUID regionID) 95 public void LogoutRegionAgents(UUID regionID)
83 { 96 {
84 if (Instance != this) 97 if (Instance != this)
diff --git a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
index ebbe8d3..51154af 100644
--- a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
@@ -60,6 +60,16 @@ namespace OpenSim.Data.PGSQL
60 return ret[0]; 60 return ret[0];
61 } 61 }
62 62
63 public PresenceData GetByUser(UUID userID)
64 {
65 PresenceData[] ret = Get("UserID", userID.ToString());
66
67 if (ret.Length == 0)
68 return null;
69
70 return ret[0];
71 }
72
63 public void LogoutRegionAgents(UUID regionID) 73 public void LogoutRegionAgents(UUID regionID)
64 { 74 {
65 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) 75 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))