From da2b23f18d232230ac4d967f8d3b256aebd4741e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 20 Oct 2012 02:02:13 +0100
Subject: Improve efficiency of friends notification by only make one
 PresenceService call for all friends rather than one for each friend.

However, large groups could still take a very long time since we still need to message each avatar on different simulators.
---
 OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs | 4 ++--
 OpenSim/Services/HypergridService/HGFriendsService.cs      | 2 +-
 OpenSim/Services/HypergridService/UserAgentService.cs      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'OpenSim/Services')

diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index e235733..6d5ce4b 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors.Friends
             return Call(region, sendData);
         }
 
-        public bool StatusNotify(GridRegion region, UUID userID, UUID friendID, bool online)
+        public bool StatusNotify(GridRegion region, UUID userID, string friendID, bool online)
         {
             Dictionary<string, object> sendData = new Dictionary<string, object>();
             //sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
@@ -136,7 +136,7 @@ namespace OpenSim.Services.Connectors.Friends
             sendData["METHOD"] = "status";
 
             sendData["FromID"] = userID.ToString();
-            sendData["ToID"] = friendID.ToString();
+            sendData["ToID"] = friendID;
             sendData["Online"] = online.ToString();
 
             return Call(region, sendData);
diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs
index 98423d7..a8bcfb2 100644
--- a/OpenSim/Services/HypergridService/HGFriendsService.cs
+++ b/OpenSim/Services/HypergridService/HGFriendsService.cs
@@ -397,7 +397,7 @@ namespace OpenSim.Services.HypergridService
                     if (region != null)
                     {
                         m_log.DebugFormat("[HGFRIENDS SERVICE]: Remote Notify to region {0}, user {1} is {2}", region.RegionName, foreignUserID, (online ? "online" : "offline"));
-                        m_FriendsSimConnector.StatusNotify(region, foreignUserID, userID, online);
+                        m_FriendsSimConnector.StatusNotify(region, foreignUserID, userID.ToString(), online);
                     }
                 }
             }
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index a6fc731..a26a922 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -504,7 +504,7 @@ namespace OpenSim.Services.HypergridService
                     if (region != null)
                     {
                         m_log.DebugFormat("[USER AGENT SERVICE]: Remote Notify to region {0}, user {1} is {2}", region.RegionName, foreignUserID, (online ? "online" : "offline"));
-                        m_FriendsSimConnector.StatusNotify(region, foreignUserID, userID, online);
+                        m_FriendsSimConnector.StatusNotify(region, foreignUserID, userID.ToString(), online);
                     }
                 }
             }
-- 
cgit v1.1