Finish the "Get friends" method

slimupdates
Melanie 2010-02-07 12:06:00 +00:00
parent e251f42443
commit c6adbccc27
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,12 @@ namespace OpenSim.Data.MySQL
public FriendsData[] GetFriends(UUID principalID) public FriendsData[] GetFriends(UUID principalID)
{ {
return Get("PrincipalID", principalID.ToString()); MySqlCommand cmd = new MySqlCommand();
cmd.CommandText = String.Format("select a.*,b.Flags 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);
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
return DoQuery(cmd);
} }
} }
} }