From 5f311c91c781d09e266fb76cb7747550fe2afc16 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Jun 2011 21:07:50 -0700 Subject: More tweaking on the UserAgentServiceConnector: add constructor that does not do DNS lookup, and use that for friends notification. --- OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index b9d6719..b8342ef 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -278,7 +278,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends List ids = new List(); foreach (FriendInfo f in kvp.Value) ids.Add(f.Friend); - UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); + UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key, false); List friendsOnline = uConn.StatusNotification(ids, userID, online); // need to debug this here if (online) -- cgit v1.1 From e07d71d2982ac2c128035fee29991eda949bd8dd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Jun 2011 21:17:34 -0700 Subject: Added a Sleep in between each site call, to slow the xml-rpc requests down. --- .../CoreModules/Avatar/Friends/HGFriendsModule.cs | 77 +++++++++++----------- 1 file changed, 40 insertions(+), 37 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index b8342ef..40506a5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -29,6 +29,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; +using System.Threading; + using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -194,46 +196,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends //} - private void CollectOnlineFriendsElsewhere(UUID userID, List foreignFriends) - { - // let's divide the friends on a per-domain basis - Dictionary> friendsPerDomain = new Dictionary>(); - foreach (string friend in foreignFriends) - { - UUID friendID; - if (!UUID.TryParse(friend, out friendID)) - { - // it's a foreign friend - string url = string.Empty, tmp = string.Empty; - if (Util.ParseUniversalUserIdentifier(friend, out friendID, out url, out tmp, out tmp, out tmp)) - { - if (!friendsPerDomain.ContainsKey(url)) - friendsPerDomain[url] = new List(); - friendsPerDomain[url].Add(friend); - } - } - } + //private void CollectOnlineFriendsElsewhere(UUID userID, List foreignFriends) + //{ + // // let's divide the friends on a per-domain basis + // Dictionary> friendsPerDomain = new Dictionary>(); + // foreach (string friend in foreignFriends) + // { + // UUID friendID; + // if (!UUID.TryParse(friend, out friendID)) + // { + // // it's a foreign friend + // string url = string.Empty, tmp = string.Empty; + // if (Util.ParseUniversalUserIdentifier(friend, out friendID, out url, out tmp, out tmp, out tmp)) + // { + // if (!friendsPerDomain.ContainsKey(url)) + // friendsPerDomain[url] = new List(); + // friendsPerDomain[url].Add(friend); + // } + // } + // } - // Now, call those worlds + // // Now, call those worlds - foreach (KeyValuePair> kvp in friendsPerDomain) - { - List ids = new List(); - foreach (string f in kvp.Value) - ids.Add(f); - UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); - List online = uConn.GetOnlineFriends(userID, ids); - // Finally send the notifications to the user - // this whole process may take a while, so let's check at every - // iteration that the user is still here - IClientAPI client = LocateClientObject(userID); - if (client != null) - client.SendAgentOnline(online.ToArray()); - else - break; - } + // foreach (KeyValuePair> kvp in friendsPerDomain) + // { + // List ids = new List(); + // foreach (string f in kvp.Value) + // ids.Add(f); + // UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); + // List online = uConn.GetOnlineFriends(userID, ids); + // // Finally send the notifications to the user + // // this whole process may take a while, so let's check at every + // // iteration that the user is still here + // IClientAPI client = LocateClientObject(userID); + // if (client != null) + // client.SendAgentOnline(online.ToArray()); + // else + // break; + // } - } + //} protected override void StatusNotify(List friendList, UUID userID, bool online) { @@ -280,6 +282,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends ids.Add(f.Friend); UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key, false); List friendsOnline = uConn.StatusNotification(ids, userID, online); + Thread.Sleep(100); // need to debug this here if (online) { -- cgit v1.1