29 using System.Collections;
30 using System.Collections.Generic;
33 using OpenSim.Framework;
34 using MySql.Data.MySqlClient;
36 namespace OpenSim.Data.MySQL
41 : base(connectionString, realm,
"FriendsStore")
45 public bool Delete(UUID principalID,
string friend)
47 return Delete(principalID.ToString(),
friend);
50 public override bool Delete(
string principalID,
string friend)
52 using (MySqlCommand cmd =
new MySqlCommand())
54 cmd.CommandText = String.Format(
"delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm);
55 cmd.Parameters.AddWithValue(
"?PrincipalID", principalID.ToString());
56 cmd.Parameters.AddWithValue(
"?Friend",
friend);
66 using (MySqlCommand cmd =
new MySqlCommand())
68 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);
69 cmd.Parameters.AddWithValue(
"?PrincipalID", principalID.ToString());
77 using (MySqlCommand cmd =
new MySqlCommand())
79 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 LIKE ?PrincipalID", m_Realm);
80 cmd.Parameters.AddWithValue(
"?PrincipalID", principalID.ToString() +
'%');
bool Delete(UUID principalID, string friend)
override bool Delete(string principalID, string friend)
An interface for connecting to the friends datastore
FriendsData[] GetFriends(string principalID)
FriendsData[] GetFriends(UUID principalID)
MySqlFriendsData(string connectionString, string realm)