diff options
author | Justin Clark-Casey (justincc) | 2014-03-11 00:11:18 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-03-11 00:11:18 +0000 |
commit | 77e7bbcbf753018074211ca8358c642dd7204f42 (patch) | |
tree | ac9b00f652a34d9b7d15a442c86d6de5231144fa /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |
parent | Remove try/catch in LandManagmentModule.GetLandObject() - this is very old co... (diff) | |
download | opensim-SC-77e7bbcbf753018074211ca8358c642dd7204f42.zip opensim-SC-77e7bbcbf753018074211ca8358c642dd7204f42.tar.gz opensim-SC-77e7bbcbf753018074211ca8358c642dd7204f42.tar.bz2 opensim-SC-77e7bbcbf753018074211ca8358c642dd7204f42.tar.xz |
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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 62020ee..d4f70a7 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -77,9 +77,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
77 | 77 | ||
78 | private List<Scene> m_sceneList = new List<Scene>(); | 78 | private List<Scene> m_sceneList = new List<Scene>(); |
79 | 79 | ||
80 | private IMessageTransferModule m_msgTransferModule = null; | 80 | private IMessageTransferModule m_msgTransferModule; |
81 | |||
82 | private IGroupsMessagingModule m_groupsMessagingModule; | ||
81 | 83 | ||
82 | private IGroupsServicesConnector m_groupData = null; | 84 | private IGroupsServicesConnector m_groupData; |
83 | 85 | ||
84 | // Configuration settings | 86 | // Configuration settings |
85 | private bool m_groupsEnabled = false; | 87 | private bool m_groupsEnabled = false; |
@@ -185,10 +187,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
185 | if (m_msgTransferModule == null) | 187 | if (m_msgTransferModule == null) |
186 | { | 188 | { |
187 | m_groupsEnabled = false; | 189 | m_groupsEnabled = false; |
188 | m_log.Warn("[GROUPS]: Could not get MessageTransferModule"); | 190 | m_log.Warn("[GROUPS]: Could not get IMessageTransferModule"); |
189 | } | 191 | } |
190 | } | 192 | } |
191 | 193 | ||
194 | if (m_groupsMessagingModule == null) | ||
195 | { | ||
196 | m_groupsMessagingModule = scene.RequestModuleInterface<IGroupsMessagingModule>(); | ||
197 | |||
198 | // No message transfer module, no notices, group invites, rejects, ejects, etc | ||
199 | if (m_groupsMessagingModule == null) | ||
200 | m_log.Warn("[GROUPS]: Could not get IGroupsMessagingModule"); | ||
201 | } | ||
202 | |||
192 | lock (m_sceneList) | 203 | lock (m_sceneList) |
193 | { | 204 | { |
194 | m_sceneList.Add(scene); | 205 | m_sceneList.Add(scene); |
@@ -497,32 +508,37 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
497 | OnNewGroupNotice(GroupID, NoticeID); | 508 | OnNewGroupNotice(GroupID, NoticeID); |
498 | } | 509 | } |
499 | 510 | ||
500 | /*** We would insert call code here ***/ | 511 | if (m_debugEnabled) |
501 | // Send notice out to everyone that wants notices | ||
502 | foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), GroupID)) | ||
503 | { | 512 | { |
504 | if (m_debugEnabled) | 513 | foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), GroupID)) |
505 | { | 514 | { |
506 | UserAccount targetUser = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, member.AgentID); | 515 | if (m_debugEnabled) |
507 | if (targetUser != null) | ||
508 | { | 516 | { |
509 | m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUser.FirstName + " " + targetUser.LastName, member.AcceptNotices); | 517 | UserAccount targetUser |
510 | } | 518 | = m_sceneList[0].UserAccountService.GetUserAccount( |
511 | else | 519 | remoteClient.Scene.RegionInfo.ScopeID, member.AgentID); |
512 | { | 520 | |
513 | m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, member.AgentID, member.AcceptNotices); | 521 | if (targetUser != null) |
522 | { | ||
523 | m_log.DebugFormat( | ||
524 | "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", | ||
525 | NoticeID, targetUser.FirstName + " " + targetUser.LastName, member.AcceptNotices); | ||
526 | } | ||
527 | else | ||
528 | { | ||
529 | m_log.DebugFormat( | ||
530 | "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", | ||
531 | NoticeID, member.AgentID, member.AcceptNotices); | ||
532 | } | ||
514 | } | 533 | } |
515 | } | 534 | } |
535 | } | ||
516 | 536 | ||
517 | if (member.AcceptNotices) | 537 | GridInstantMessage msg |
518 | { | 538 | = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); |
519 | // Build notice IM | ||
520 | GridInstantMessage msg = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); | ||
521 | 539 | ||
522 | msg.toAgentID = member.AgentID.Guid; | 540 | if (m_groupsMessagingModule != null) |
523 | OutgoingInstantMessage(msg, member.AgentID); | 541 | m_groupsMessagingModule.SendMessageToGroup(msg, GroupID, gmd => gmd.AcceptNotices); |
524 | } | ||
525 | } | ||
526 | } | 542 | } |
527 | } | 543 | } |
528 | 544 | ||