aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorDiva Canto2011-05-21 16:48:00 -0700
committerDiva Canto2011-05-21 16:48:00 -0700
commit58c53c41de2cae0bb041a2e8121792e136d1edb2 (patch)
treeb792158cd178f88234f86ab4d72c4224b45fe6ba /OpenSim/Data
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.zip
opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.gz
opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.bz2
opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.xz
Fixed permissions bug related to friends in PermissionsModule. Added FriendsData[] GetFriends(string principalID) to IFriendsData and FriendInfo[] GetFriends(string PrincipalID) to IFriendsService. Refactored some more in the FriendsModule. Made client get notification of local friends permissions upon HGLogin. HG Friends object permissions work.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/IFriendsData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLFriendsData.cs6
-rw-r--r--OpenSim/Data/MySQL/MySQLFriendsData.cs5
-rw-r--r--OpenSim/Data/Null/NullFriendsData.cs7
-rw-r--r--OpenSim/Data/SQLite/SQLiteFriendsData.cs7
5 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Data/IFriendsData.cs b/OpenSim/Data/IFriendsData.cs
index 4da567e..52e7f14 100644
--- a/OpenSim/Data/IFriendsData.cs
+++ b/OpenSim/Data/IFriendsData.cs
@@ -47,5 +47,6 @@ namespace OpenSim.Data
47 bool Store(FriendsData data); 47 bool Store(FriendsData data);
48 bool Delete(UUID ownerID, string friend); 48 bool Delete(UUID ownerID, string friend);
49 FriendsData[] GetFriends(UUID principalID); 49 FriendsData[] GetFriends(UUID principalID);
50 FriendsData[] GetFriends(string principalID);
50 } 51 }
51} 52}
diff --git a/OpenSim/Data/MSSQL/MSSQLFriendsData.cs b/OpenSim/Data/MSSQL/MSSQLFriendsData.cs
index af4fd9b..ba1b085 100644
--- a/OpenSim/Data/MSSQL/MSSQLFriendsData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLFriendsData.cs
@@ -68,6 +68,11 @@ namespace OpenSim.Data.MSSQL
68 68
69 public FriendsData[] GetFriends(UUID principalID) 69 public FriendsData[] GetFriends(UUID principalID)
70 { 70 {
71 return GetFriends(principalID.ToString());
72 }
73
74 public FriendsData[] GetFriends(string principalID)
75 {
71 using (SqlConnection conn = new SqlConnection(m_ConnectionString)) 76 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
72 using (SqlCommand cmd = new SqlCommand()) 77 using (SqlCommand cmd = new SqlCommand())
73 { 78 {
@@ -79,5 +84,6 @@ namespace OpenSim.Data.MSSQL
79 return DoQuery(cmd); 84 return DoQuery(cmd);
80 } 85 }
81 } 86 }
87
82 } 88 }
83} 89}
diff --git a/OpenSim/Data/MySQL/MySQLFriendsData.cs b/OpenSim/Data/MySQL/MySQLFriendsData.cs
index 663fad6..69fac9d 100644
--- a/OpenSim/Data/MySQL/MySQLFriendsData.cs
+++ b/OpenSim/Data/MySQL/MySQLFriendsData.cs
@@ -57,6 +57,11 @@ namespace OpenSim.Data.MySQL
57 57
58 public FriendsData[] GetFriends(UUID principalID) 58 public FriendsData[] GetFriends(UUID principalID)
59 { 59 {
60 return GetFriends(principalID.ToString());
61 }
62
63 public FriendsData[] GetFriends(string principalID)
64 {
60 MySqlCommand cmd = new MySqlCommand(); 65 MySqlCommand cmd = new MySqlCommand();
61 66
62 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); 67 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);
diff --git a/OpenSim/Data/Null/NullFriendsData.cs b/OpenSim/Data/Null/NullFriendsData.cs
index 0c69bb1..2bfdc7a 100644
--- a/OpenSim/Data/Null/NullFriendsData.cs
+++ b/OpenSim/Data/Null/NullFriendsData.cs
@@ -42,6 +42,11 @@ namespace OpenSim.Data.Null
42 { 42 {
43 } 43 }
44 44
45 public FriendsData[] GetFriends(UUID principalID)
46 {
47 return GetFriends(principalID.ToString());
48 }
49
45 /// <summary> 50 /// <summary>
46 /// Tries to implement the Get [] semantics, but it cuts corners. 51 /// Tries to implement the Get [] semantics, but it cuts corners.
47 /// Specifically, it gets all friendships even if they weren't accepted yet. 52 /// Specifically, it gets all friendships even if they weren't accepted yet.
@@ -49,7 +54,7 @@ namespace OpenSim.Data.Null
49 /// <param name="fields"></param> 54 /// <param name="fields"></param>
50 /// <param name="values"></param> 55 /// <param name="values"></param>
51 /// <returns></returns> 56 /// <returns></returns>
52 public FriendsData[] GetFriends(UUID userID) 57 public FriendsData[] GetFriends(string userID)
53 { 58 {
54 List<FriendsData> lst = m_Data.FindAll(delegate (FriendsData fdata) 59 List<FriendsData> lst = m_Data.FindAll(delegate (FriendsData fdata)
55 { 60 {
diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
index 4bfd228..d925412 100644
--- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs
+++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
@@ -46,7 +46,12 @@ namespace OpenSim.Data.SQLite
46 { 46 {
47 } 47 }
48 48
49 public FriendsData[] GetFriends(UUID userID) 49 public FriendsData[] GetFriends(UUID principalID)
50 {
51 return GetFriends(principalID.ToString());
52 }
53
54 public FriendsData[] GetFriends(string userID)
50 { 55 {
51 SqliteCommand cmd = new SqliteCommand(); 56 SqliteCommand cmd = new SqliteCommand();
52 57