diff options
author | BlueWall | 2012-11-25 17:03:14 -0500 |
---|---|---|
committer | BlueWall | 2012-11-25 17:03:14 -0500 |
commit | c754003944d0166bf50b4f94b0c0eea642503bb0 (patch) | |
tree | dfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Data/SQLite/SQLiteFriendsData.cs | |
parent | Merge branch 'master' into connector_plugin (diff) | |
parent | Combine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff) | |
download | opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.zip opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2 opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz |
Merge branch 'master' into connector_plugin
Conflicts:
OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteFriendsData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteFriendsData.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs index 5f68977..cab85eb 100644 --- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs +++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs | |||
@@ -53,13 +53,13 @@ namespace OpenSim.Data.SQLite | |||
53 | 53 | ||
54 | public FriendsData[] GetFriends(string userID) | 54 | public FriendsData[] GetFriends(string userID) |
55 | { | 55 | { |
56 | SqliteCommand cmd = new SqliteCommand(); | 56 | using (SqliteCommand cmd = new SqliteCommand()) |
57 | 57 | { | |
58 | cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = :PrincipalID", m_Realm); | 58 | cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = :PrincipalID", m_Realm); |
59 | cmd.Parameters.AddWithValue(":PrincipalID", userID.ToString()); | 59 | cmd.Parameters.AddWithValue(":PrincipalID", userID.ToString()); |
60 | |||
61 | return DoQuery(cmd); | ||
62 | 60 | ||
61 | return DoQuery(cmd); | ||
62 | } | ||
63 | } | 63 | } |
64 | 64 | ||
65 | public bool Delete(UUID principalID, string friend) | 65 | public bool Delete(UUID principalID, string friend) |
@@ -69,13 +69,14 @@ namespace OpenSim.Data.SQLite | |||
69 | 69 | ||
70 | public bool Delete(string principalID, string friend) | 70 | public bool Delete(string principalID, string friend) |
71 | { | 71 | { |
72 | SqliteCommand cmd = new SqliteCommand(); | 72 | using (SqliteCommand cmd = new SqliteCommand()) |
73 | 73 | { | |
74 | cmd.CommandText = String.Format("delete from {0} where PrincipalID = :PrincipalID and Friend = :Friend", m_Realm); | 74 | cmd.CommandText = String.Format("delete from {0} where PrincipalID = :PrincipalID and Friend = :Friend", m_Realm); |
75 | cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString()); | 75 | cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString()); |
76 | cmd.Parameters.AddWithValue(":Friend", friend); | 76 | cmd.Parameters.AddWithValue(":Friend", friend); |
77 | 77 | ||
78 | ExecuteNonQuery(cmd, m_Connection); | 78 | ExecuteNonQuery(cmd, m_Connection); |
79 | } | ||
79 | 80 | ||
80 | return true; | 81 | return true; |
81 | } | 82 | } |