From bbb43f9bdeda4994653c72fac62f9023d6dbdcdc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 26 Feb 2010 10:35:23 -0800 Subject: [PATCH] Now showing friends online upon grid login. --- .../Region/CoreModules/Avatar/Friends/FriendsModule.cs | 6 ++++++ OpenSim/Server/Base/ServerUtils.cs | 9 +++++---- .../Handlers/Presence/PresenceServerPostHandler.cs | 3 +++ .../Connectors/Presence/PresenceServiceConnector.cs | 4 ++-- OpenSim/Services/PresenceService/PresenceService.cs | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 8b15abb192..d38ce686d6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -331,11 +331,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void SendPresence(UUID agentID) { if (!m_Friends.ContainsKey(agentID)) + { + m_log.DebugFormat("[FRIENDS MODULE]: agent {0} not found in local cache", agentID); return; + } IClientAPI client = LocateClientObject(agentID); if (client == null) + { + m_log.DebugFormat("[FRIENDS MODULE]: agent's client {0} not found in local scene", agentID); return; + } List friendList = new List(); diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 2fbcea4323..9c5441031d 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -140,12 +140,13 @@ namespace OpenSim.Server.Base if (name.EndsWith("[]")) { - if (result.ContainsKey(name)) + string cleanName = name.Substring(0, name.Length - 2); + if (result.ContainsKey(cleanName)) { - if (!(result[name] is List)) + if (!(result[cleanName] is List)) continue; - List l = (List)result[name]; + List l = (List)result[cleanName]; l.Add(value); } @@ -155,7 +156,7 @@ namespace OpenSim.Server.Base newList.Add(value); - result[name] = newList; + result[cleanName] = newList; } } else diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index d180bbb749..4ebf93329c 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -227,7 +227,10 @@ namespace OpenSim.Server.Handlers.Presence string[] userIDs; if (!request.ContainsKey("uuids")) + { + m_log.DebugFormat("[PRESENCE HANDLER]: GetAgents called without required uuids argument"); return FailureResult(); + } if (!(request["uuids"] is List)) { diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs index fac3d1f3c9..cc219cc632 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs @@ -321,7 +321,7 @@ namespace OpenSim.Services.Connectors string reply = string.Empty; string reqString = ServerUtils.BuildQueryString(sendData); - // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); + //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); try { reply = SynchronousRestFormsRequester.MakeRequest("POST", @@ -351,7 +351,7 @@ namespace OpenSim.Services.Connectors } Dictionary.ValueCollection pinfosList = replyData.Values; - //m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count); + m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count); foreach (object presence in pinfosList) { if (presence is Dictionary) diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 350eac8730..1a3196589f 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -206,6 +206,7 @@ namespace OpenSim.Services.PresenceService } } + m_log.DebugFormat("[PRESENCE SERVICE]: GetAgents for {0} userIDs found {1} presences", userIDs.Length, info.Count); return info.ToArray(); }