29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Threading;
35 using OpenSim.Framework;
38 namespace OpenSim.Data.PGSQL
49 base(connectionString, realm,
"Presence")
55 PresenceData[] ret = Get(
"SessionID", sessionID.ToString());
65 using (NpgsqlConnection conn =
new NpgsqlConnection(m_ConnectionString))
66 using (NpgsqlCommand cmd =
new NpgsqlCommand())
69 cmd.CommandText = String.Format(
"DELETE FROM {0} WHERE \"RegionID\" = :regionID", m_Realm);
71 cmd.Parameters.Add(m_database.CreateParameter(
"RegionID", regionID));
72 cmd.Connection = conn;
74 cmd.ExecuteNonQuery();
80 PresenceData[] pd = Get(
"SessionID", sessionID.ToString());
84 if (regionID == UUID.Zero)
87 using (NpgsqlConnection conn =
new NpgsqlConnection(m_ConnectionString))
88 using (NpgsqlCommand cmd =
new NpgsqlCommand())
91 cmd.CommandText = String.Format(
"UPDATE {0} SET \"RegionID\" = :regionID, \"LastSeen\" = now() WHERE \"SessionID\" = :sessionID", m_Realm);
93 cmd.Parameters.Add(m_database.CreateParameter(
"SessionID", sessionID));
94 cmd.Parameters.Add(m_database.CreateParameter(
"RegionID", regionID));
95 cmd.Connection = conn;
97 if (cmd.ExecuteNonQuery() == 0)
105 PresenceData[] ret = Get(
"SecureSessionID", secureSessionID.ToString());
110 if(ret[0].UserID != agentId.ToString())
PresenceData Get(UUID sessionID)
An interface for connecting to the presence datastore
PGSQLPresenceData(string connectionString, string realm)
bool VerifyAgent(UUID agentId, UUID secureSessionID)
bool ReportAgent(UUID sessionID, UUID regionID)
void LogoutRegionAgents(UUID regionID)
A PGSQL Interface for the Presence Server