aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorMelanie2011-06-11 12:08:02 +0100
committerMelanie2011-06-11 12:08:02 +0100
commita1c16a42002757f65d77b530571405bd740bf2f7 (patch)
tree6b86e3ddd09538f83c541a36d02f6668eeed8745 /OpenSim/Region/CoreModules/Avatar
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentAdded a Sleep in between each site call, to slow the xml-rpc requests down. (diff)
downloadopensim-SC-a1c16a42002757f65d77b530571405bd740bf2f7.zip
opensim-SC-a1c16a42002757f65d77b530571405bd740bf2f7.tar.gz
opensim-SC-a1c16a42002757f65d77b530571405bd740bf2f7.tar.bz2
opensim-SC-a1c16a42002757f65d77b530571405bd740bf2f7.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs79
1 files changed, 41 insertions, 38 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index b9d6719..40506a5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -29,6 +29,8 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using System.Threading;
33
32using log4net; 34using log4net;
33using Nini.Config; 35using Nini.Config;
34using Nwc.XmlRpc; 36using Nwc.XmlRpc;
@@ -194,46 +196,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
194 196
195 //} 197 //}
196 198
197 private void CollectOnlineFriendsElsewhere(UUID userID, List<string> foreignFriends) 199 //private void CollectOnlineFriendsElsewhere(UUID userID, List<string> foreignFriends)
198 { 200 //{
199 // let's divide the friends on a per-domain basis 201 // // let's divide the friends on a per-domain basis
200 Dictionary<string, List<string>> friendsPerDomain = new Dictionary<string, List<string>>(); 202 // Dictionary<string, List<string>> friendsPerDomain = new Dictionary<string, List<string>>();
201 foreach (string friend in foreignFriends) 203 // foreach (string friend in foreignFriends)
202 { 204 // {
203 UUID friendID; 205 // UUID friendID;
204 if (!UUID.TryParse(friend, out friendID)) 206 // if (!UUID.TryParse(friend, out friendID))
205 { 207 // {
206 // it's a foreign friend 208 // // it's a foreign friend
207 string url = string.Empty, tmp = string.Empty; 209 // string url = string.Empty, tmp = string.Empty;
208 if (Util.ParseUniversalUserIdentifier(friend, out friendID, out url, out tmp, out tmp, out tmp)) 210 // if (Util.ParseUniversalUserIdentifier(friend, out friendID, out url, out tmp, out tmp, out tmp))
209 { 211 // {
210 if (!friendsPerDomain.ContainsKey(url)) 212 // if (!friendsPerDomain.ContainsKey(url))
211 friendsPerDomain[url] = new List<string>(); 213 // friendsPerDomain[url] = new List<string>();
212 friendsPerDomain[url].Add(friend); 214 // friendsPerDomain[url].Add(friend);
213 } 215 // }
214 } 216 // }
215 } 217 // }
216 218
217 // Now, call those worlds 219 // // Now, call those worlds
218 220
219 foreach (KeyValuePair<string, List<string>> kvp in friendsPerDomain) 221 // foreach (KeyValuePair<string, List<string>> kvp in friendsPerDomain)
220 { 222 // {
221 List<string> ids = new List<string>(); 223 // List<string> ids = new List<string>();
222 foreach (string f in kvp.Value) 224 // foreach (string f in kvp.Value)
223 ids.Add(f); 225 // ids.Add(f);
224 UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); 226 // UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key);
225 List<UUID> online = uConn.GetOnlineFriends(userID, ids); 227 // List<UUID> online = uConn.GetOnlineFriends(userID, ids);
226 // Finally send the notifications to the user 228 // // Finally send the notifications to the user
227 // this whole process may take a while, so let's check at every 229 // // this whole process may take a while, so let's check at every
228 // iteration that the user is still here 230 // // iteration that the user is still here
229 IClientAPI client = LocateClientObject(userID); 231 // IClientAPI client = LocateClientObject(userID);
230 if (client != null) 232 // if (client != null)
231 client.SendAgentOnline(online.ToArray()); 233 // client.SendAgentOnline(online.ToArray());
232 else 234 // else
233 break; 235 // break;
234 } 236 // }
235 237
236 } 238 //}
237 239
238 protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online) 240 protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
239 { 241 {
@@ -278,8 +280,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
278 List<string> ids = new List<string>(); 280 List<string> ids = new List<string>();
279 foreach (FriendInfo f in kvp.Value) 281 foreach (FriendInfo f in kvp.Value)
280 ids.Add(f.Friend); 282 ids.Add(f.Friend);
281 UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); 283 UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key, false);
282 List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online); 284 List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online);
285 Thread.Sleep(100);
283 // need to debug this here 286 // need to debug this here
284 if (online) 287 if (online)
285 { 288 {