From f85b23edea3af2880086d096c85838cf48dd01a4 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 8 Dec 2012 17:33:03 -0500 Subject: Add agent verification to Presence --- OpenSim/Data/IPresenceData.cs | 1 + OpenSim/Data/MSSQL/MSSQLPresenceData.cs | 11 +++++++++++ OpenSim/Data/MySQL/MySQLPresenceData.cs | 11 +++++++++++ OpenSim/Data/Null/NullPresenceData.cs | 13 +++++++++++++ 4 files changed, 36 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index b871f56..2759a42 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs @@ -53,5 +53,6 @@ namespace OpenSim.Data bool ReportAgent(UUID sessionID, UUID regionID); PresenceData[] Get(string field, string data); bool Delete(string field, string val); + PresenceData VerifyAgent(UUID secureSessionID); } } diff --git a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs index 8068d23..5f495ae 100644 --- a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs +++ b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs @@ -100,5 +100,16 @@ namespace OpenSim.Data.MSSQL return true; } + public PresenceData VerifyAgent(UUID secureSessionID) + { + PresenceData[] ret = Get("SecureSessionID", + secureSessionID.ToString()); + + if (ret.Length == 0) + return null; + + return ret[0]; + } + } } diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 7808060..577a71a 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -95,5 +95,16 @@ namespace OpenSim.Data.MySQL return true; } + + public PresenceData VerifyAgent(UUID secureSessionID) + { + PresenceData[] ret = Get("SecureSessionID", + secureSessionID.ToString()); + + if (ret.Length == 0) + return null; + + return ret[0]; + } } } \ No newline at end of file diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index c06c223..eafde95 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs @@ -222,5 +222,18 @@ namespace OpenSim.Data.Null return true; } + public PresenceData VerifyAgent(UUID secureSessionID) + { + if (Instance != this) + return Instance.VerifyAgent(secureSessionID); + + if (m_presenceData.ContainsKey(secureSessionID)) + { + return m_presenceData[secureSessionID]; + } + + return null; + } + } } -- cgit v1.1