From 77e7bbcbf753018074211ca8358c642dd7204f42 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 11 Mar 2014 00:11:18 +0000 Subject: Send group notices through the same messaging module mechanism used to send group chat to avoid timeout issues when sending messages to large groups. Only implementing for XmlRpcGroups initially to test. May require MessageOnlineUsersOnly = true in [Groups] to be effective. In relation to http://opensimulator.org/mantis/view.php?id=7037 --- OpenSim/Addons/Groups/GroupsMessagingModule.cs | 29 ++++++++++++++++++++------ OpenSim/Addons/Groups/GroupsModule.cs | 4 +--- 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'OpenSim/Addons') diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index be59c62..f701e48 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -172,10 +172,8 @@ namespace OpenSim.Groups return; } - if (m_presenceService == null) m_presenceService = scene.PresenceService; - } public void RemoveRegion(Scene scene) @@ -222,7 +220,6 @@ namespace OpenSim.Groups #endregion - /// /// Not really needed, but does confirm that the group exists. /// @@ -242,9 +239,14 @@ namespace OpenSim.Groups return false; } } - + public void SendMessageToGroup(GridInstantMessage im, UUID groupID) { + SendMessageToGroup(im, groupID, null); + } + + public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func sendCondition) + { UUID fromAgentID = new UUID(im.fromAgentID); List groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID); int groupMembersCount = groupMembers.Count; @@ -299,12 +301,27 @@ namespace OpenSim.Groups if (clientsAlreadySent.Contains(member.AgentID)) continue; + clientsAlreadySent.Add(member.AgentID); - if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) + if (sendCondition != null) + { + if (!sendCondition(member)) + { + if (m_debugEnabled) + m_log.DebugFormat( + "[Groups.Messaging]: Not sending to {0} as they do not fulfill send condition", + member.AgentID); + + continue; + } + } + else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) { // Don't deliver messages to people who have dropped this session - if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID); + if (m_debugEnabled) + m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID); + continue; } diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index b0493fa..7f453db 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -45,9 +45,6 @@ namespace OpenSim.Groups [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")] public class GroupsModule : ISharedRegionModule, IGroupsModule { - /// - /// - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -466,6 +463,7 @@ namespace OpenSim.Groups OnNewGroupNotice(GroupID, NoticeID); } + // Send notice out to everyone that wants notices foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID)) { -- cgit v1.1