diff options
author | Geir Nøklebye | 2015-07-25 20:35:25 +0200 |
---|---|---|
committer | Oren Hurvitz | 2015-07-26 11:59:15 +0100 |
commit | a7fccbcf6fc4a6b42ce6381c65c85b3ca7fdee3e (patch) | |
tree | e1db8a02d0c706535af733ccd75d9f4fd1c56230 /OpenSim/Data/PGSQL/PGSQLPresenceData.cs | |
parent | Add LogFile option in OpenSimDefaults.ini. It was omitted accidentally (diff) | |
download | opensim-SC-a7fccbcf6fc4a6b42ce6381c65c85b3ca7fdee3e.zip opensim-SC-a7fccbcf6fc4a6b42ce6381c65c85b3ca7fdee3e.tar.gz opensim-SC-a7fccbcf6fc4a6b42ce6381c65c85b3ca7fdee3e.tar.bz2 opensim-SC-a7fccbcf6fc4a6b42ce6381c65c85b3ca7fdee3e.tar.xz |
Update PGSQL groups handler to accept search queries from the viewer
Update PGSQL groups handler to accept search queries from the viewer.
Fixed malformed query strings.
Signed-off-by: Oren Hurvitz <orenh@kitely.com>
Diffstat (limited to '')
-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)); |