diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLPresenceData.cs')
-rwxr-xr-x[-rw-r--r--] | OpenSim/Data/PGSQL/PGSQLPresenceData.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs index 666de07..0376585 100644..100755 --- a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs +++ b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Data.PGSQL | |||
66 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 66 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
67 | { | 67 | { |
68 | 68 | ||
69 | cmd.CommandText = String.Format(@"DELETE FROM {0} WHERE ""RegionID""=:RegionID", m_Realm); | 69 | cmd.CommandText = String.Format("DELETE FROM {0} WHERE \"RegionID\" = :regionID", m_Realm); |
70 | 70 | ||
71 | cmd.Parameters.Add(m_database.CreateParameter("RegionID", regionID)); | 71 | cmd.Parameters.Add(m_database.CreateParameter("RegionID", regionID)); |
72 | cmd.Connection = conn; | 72 | cmd.Connection = conn; |
@@ -80,14 +80,15 @@ namespace OpenSim.Data.PGSQL | |||
80 | PresenceData[] pd = Get("SessionID", sessionID.ToString()); | 80 | PresenceData[] pd = Get("SessionID", sessionID.ToString()); |
81 | if (pd.Length == 0) | 81 | if (pd.Length == 0) |
82 | return false; | 82 | return false; |
83 | |||
84 | if (regionID == UUID.Zero) | ||
85 | return false; | ||
83 | 86 | ||
84 | using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) | 87 | using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) |
85 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 88 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
86 | { | 89 | { |
87 | 90 | ||
88 | cmd.CommandText = String.Format(@"UPDATE {0} SET | 91 | cmd.CommandText = String.Format("UPDATE {0} SET \"RegionID\" = :regionID, \"LastSeen\" = now() WHERE \"SessionID\" = :sessionID", m_Realm); |
89 | ""RegionID"" = :RegionID | ||
90 | WHERE ""SessionID"" = :SessionID", m_Realm); | ||
91 | 92 | ||
92 | cmd.Parameters.Add(m_database.CreateParameter("SessionID", sessionID)); | 93 | cmd.Parameters.Add(m_database.CreateParameter("SessionID", sessionID)); |
93 | cmd.Parameters.Add(m_database.CreateParameter("RegionID", regionID)); | 94 | cmd.Parameters.Add(m_database.CreateParameter("RegionID", regionID)); |