aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
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/Services/Connectors/Hypergrid
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/Services/Connectors/Hypergrid')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs37
1 files changed, 9 insertions, 28 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
index 76f5f19..f823889 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
@@ -63,12 +63,13 @@ namespace OpenSim.Services.Connectors.Hypergrid
63 63
64 #region IFriendsService 64 #region IFriendsService
65 65
66 public FriendInfo[] GetFriends(UUID PrincipalID) 66 public uint GetFriendPerms(UUID PrincipalID, UUID friendID)
67 { 67 {
68 Dictionary<string, object> sendData = new Dictionary<string, object>(); 68 Dictionary<string, object> sendData = new Dictionary<string, object>();
69 69
70 sendData["PRINCIPALID"] = PrincipalID.ToString(); 70 sendData["PRINCIPALID"] = PrincipalID.ToString();
71 sendData["METHOD"] = "getfriends"; 71 sendData["FRIENDID"] = friendID.ToString();
72 sendData["METHOD"] = "getfriendperms";
72 sendData["KEY"] = m_ServiceKey; 73 sendData["KEY"] = m_ServiceKey;
73 sendData["SESSIONID"] = m_SessionID.ToString(); 74 sendData["SESSIONID"] = m_SessionID.ToString();
74 75
@@ -83,34 +84,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
83 { 84 {
84 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 85 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
85 86
86 if (replyData != null) 87 if ((replyData != null) && replyData.ContainsKey("Value") && (replyData["Value"] != null))
87 { 88 {
88 if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null")) 89 uint perms = 0;
89 { 90 uint.TryParse(replyData["Value"].ToString(), out perms);
90 return new FriendInfo[0]; 91 return perms;
91 }
92
93 List<FriendInfo> finfos = new List<FriendInfo>();
94 Dictionary<string, object>.ValueCollection finfosList = replyData.Values;
95 //m_log.DebugFormat("[FRIENDS CONNECTOR]: get neighbours returned {0} elements", rinfosList.Count);
96 foreach (object f in finfosList)
97 {
98 if (f is Dictionary<string, object>)
99 {
100 FriendInfo finfo = new FriendInfo((Dictionary<string, object>)f);
101 finfos.Add(finfo);
102 }
103 else
104 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: GetFriends {0} received invalid response type {1}",
105 PrincipalID, f.GetType());
106 }
107
108 // Success
109 return finfos.ToArray();
110 } 92 }
111
112 else 93 else
113 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: GetFriends {0} received null response", 94 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: GetFriendPerms {0} received null response",
114 PrincipalID); 95 PrincipalID);
115 96
116 } 97 }
@@ -120,7 +101,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
120 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 101 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
121 } 102 }
122 103
123 return new FriendInfo[0]; 104 return 0;
124 105
125 } 106 }
126 107