diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs index 861c475..08f1dc3 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs | |||
@@ -38,7 +38,7 @@ using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; | |||
38 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | 40 | ||
41 | namespace OpenSim.Services.Connectors | 41 | namespace OpenSim.Services.Connectors.Friends |
42 | { | 42 | { |
43 | public class FriendsServicesConnector : IFriendsService | 43 | public class FriendsServicesConnector : IFriendsService |
44 | { | 44 | { |
@@ -84,7 +84,7 @@ namespace OpenSim.Services.Connectors | |||
84 | 84 | ||
85 | 85 | ||
86 | #region IFriendsService | 86 | #region IFriendsService |
87 | 87 | ||
88 | public FriendInfo[] GetFriends(UUID PrincipalID) | 88 | public FriendInfo[] GetFriends(UUID PrincipalID) |
89 | { | 89 | { |
90 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 90 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
@@ -92,6 +92,21 @@ namespace OpenSim.Services.Connectors | |||
92 | sendData["PRINCIPALID"] = PrincipalID.ToString(); | 92 | sendData["PRINCIPALID"] = PrincipalID.ToString(); |
93 | sendData["METHOD"] = "getfriends"; | 93 | sendData["METHOD"] = "getfriends"; |
94 | 94 | ||
95 | return GetFriends(sendData, PrincipalID.ToString()); | ||
96 | } | ||
97 | |||
98 | public FriendInfo[] GetFriends(string PrincipalID) | ||
99 | { | ||
100 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
101 | |||
102 | sendData["PRINCIPALID"] = PrincipalID; | ||
103 | sendData["METHOD"] = "getfriends_string"; | ||
104 | |||
105 | return GetFriends(sendData, PrincipalID); | ||
106 | } | ||
107 | |||
108 | protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID) | ||
109 | { | ||
95 | string reqString = ServerUtils.BuildQueryString(sendData); | 110 | string reqString = ServerUtils.BuildQueryString(sendData); |
96 | 111 | ||
97 | try | 112 | try |
@@ -144,10 +159,17 @@ namespace OpenSim.Services.Connectors | |||
144 | 159 | ||
145 | } | 160 | } |
146 | 161 | ||
147 | public bool StoreFriend(UUID PrincipalID, string Friend, int flags) | 162 | public bool StoreFriend(string PrincipalID, string Friend, int flags) |
148 | { | 163 | { |
149 | FriendInfo finfo = new FriendInfo(); | 164 | FriendInfo finfo = new FriendInfo(); |
150 | finfo.PrincipalID = PrincipalID; | 165 | try |
166 | { | ||
167 | finfo.PrincipalID = new UUID(PrincipalID); | ||
168 | } | ||
169 | catch | ||
170 | { | ||
171 | return false; | ||
172 | } | ||
151 | finfo.Friend = Friend; | 173 | finfo.Friend = Friend; |
152 | finfo.MyFlags = flags; | 174 | finfo.MyFlags = flags; |
153 | 175 | ||
@@ -189,6 +211,16 @@ namespace OpenSim.Services.Connectors | |||
189 | 211 | ||
190 | } | 212 | } |
191 | 213 | ||
214 | public bool Delete(string PrincipalID, string Friend) | ||
215 | { | ||
216 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
217 | sendData["PRINCIPALID"] = PrincipalID.ToString(); | ||
218 | sendData["FRIEND"] = Friend; | ||
219 | sendData["METHOD"] = "deletefriend_string"; | ||
220 | |||
221 | return Delete(sendData, PrincipalID, Friend); | ||
222 | } | ||
223 | |||
192 | public bool Delete(UUID PrincipalID, string Friend) | 224 | public bool Delete(UUID PrincipalID, string Friend) |
193 | { | 225 | { |
194 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 226 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
@@ -196,6 +228,11 @@ namespace OpenSim.Services.Connectors | |||
196 | sendData["FRIEND"] = Friend; | 228 | sendData["FRIEND"] = Friend; |
197 | sendData["METHOD"] = "deletefriend"; | 229 | sendData["METHOD"] = "deletefriend"; |
198 | 230 | ||
231 | return Delete(sendData, PrincipalID.ToString(), Friend); | ||
232 | } | ||
233 | |||
234 | public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) | ||
235 | { | ||
199 | string reply = string.Empty; | 236 | string reply = string.Empty; |
200 | try | 237 | try |
201 | { | 238 | { |