aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLFriendsData.cs
diff options
context:
space:
mode:
authorMelanie2010-02-05 12:31:29 +0000
committerMelanie2010-02-05 12:31:29 +0000
commitb92cb6126d8ca59121468fce44dc7b4c3b805181 (patch)
tree616a8da65aa49fe2821b9b1c4898ff3ada87f565 /OpenSim/Data/MySQL/MySQLFriendsData.cs
parentFinally cutting the gordian knot. Friends needs to be both a module and a (diff)
downloadopensim-SC-b92cb6126d8ca59121468fce44dc7b4c3b805181.zip
opensim-SC-b92cb6126d8ca59121468fce44dc7b4c3b805181.tar.gz
opensim-SC-b92cb6126d8ca59121468fce44dc7b4c3b805181.tar.bz2
opensim-SC-b92cb6126d8ca59121468fce44dc7b4c3b805181.tar.xz
Implement the friends data adaptor
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFriendsData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLFriendsData.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFriendsData.cs b/OpenSim/Data/MySQL/MySQLFriendsData.cs
index 923810b..9f7e850 100644
--- a/OpenSim/Data/MySQL/MySQLFriendsData.cs
+++ b/OpenSim/Data/MySQL/MySQLFriendsData.cs
@@ -38,19 +38,26 @@ namespace OpenSim.Data.MySQL
38 public class MySqlFriendsData : MySQLGenericTableHandler<FriendsData>, IFriendsData 38 public class MySqlFriendsData : MySQLGenericTableHandler<FriendsData>, IFriendsData
39 { 39 {
40 public MySqlFriendsData(string connectionString, string realm) 40 public MySqlFriendsData(string connectionString, string realm)
41 : base(connectionString, realm, "Friends") 41 : base(connectionString, realm, "FriendsStore")
42 { 42 {
43 } 43 }
44 44
45 public bool Delete(UUID principalID, UUID friendID) 45 public bool Delete(UUID principalID, string friend)
46 { 46 {
47 // We need to delete the row where PrincipalID=principalID AND FriendID=firnedID 47 MySqlCommand cmd = new MySqlCommand();
48 return false; 48
49 cmd.CommandText = String.Format("delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm);
50 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
51 cmd.Parameters.AddWithValue("?Friend", friend);
52
53 ExecuteNonQuery(cmd);
54
55 return true;
49 } 56 }
50 57
51 public FriendsData[] GetFriends(UUID userID) 58 public FriendsData[] GetFriends(UUID principalID)
52 { 59 {
53 return Get("PrincipalID =\'" + userID.ToString() + "'"); 60 return Get("PrincipalID", principalID.ToString());
54 } 61 }
55 } 62 }
56} 63}