From 8d99fe095a231ba71ce71712cb87f8114672e7df Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 19 Jun 2016 17:35:11 -0700
Subject: Mantis #7920: group info was not being updated in many situations.
(regression) Putting back the heavy messaging.
---
OpenSim/Addons/Groups/GroupsModule.cs | 47 +++++++++++++++++++++++++++--------
1 file changed, 37 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Addons')
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index f24670a..d27797e 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -394,9 +394,8 @@ namespace OpenSim.Groups
OutgoingInstantMessage(msg, invitee);
- IClientAPI client = GetActiveClient(invitee);
- if (client != null)
- SendDataUpdate(remoteClient, true);
+ UpdateAllClientsWithGroupInfo(invitee);
+
}
m_groupData.RemoveAgentToGroupInvite(GetRequestingAgentIDStr(remoteClient), inviteID);
@@ -1112,7 +1111,7 @@ namespace OpenSim.Groups
// SL sends out messages to everyone in the group
// Who all should receive updates and what should they be updated with?
- SendAgentGroupDataUpdate(remoteClient, false);
+ UpdateAllClientsWithGroupInfo(ejecteeID);
}
public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID)
@@ -1226,16 +1225,44 @@ namespace OpenSim.Groups
}
}
+ ///
+ /// Send updates to all clients who might be interested in groups data for dataForClientID
+ ///
+ private void UpdateAllClientsWithGroupInfo(UUID dataForClientID)
+ {
+ if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
+
+ // TODO: Probably isn't nessesary to update every client in every scene.
+ // Need to examine client updates and do only what's nessesary.
+ lock (m_sceneList)
+ {
+ foreach (Scene scene in m_sceneList)
+ {
+ scene.ForEachClient(delegate (IClientAPI client) { SendAgentGroupDataUpdate(client, dataForClientID); });
+ }
+ }
+ }
+
public void SendAgentGroupDataUpdate(IClientAPI remoteClient)
{
- SendAgentGroupDataUpdate(remoteClient, true);
+ SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient), true);
+ }
+
+ public void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID)
+ {
+ SendAgentGroupDataUpdate(remoteClient, dataForClientID, true);
}
-
- ///
- /// Tell remoteClient about its agent groups, and optionally send title to others
- ///
+
private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers)
{
+ SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient), tellOthers);
+ }
+
+ ///
+ /// Tell remoteClient about its agent groups, and optionally send title to others
+ ///
+ private void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID, bool tellOthers)
+ {
if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name);
// TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
@@ -1246,7 +1273,7 @@ namespace OpenSim.Groups
GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
IEventQueue eq = remoteClient.Scene.RequestModuleInterface();
- eq.GroupMembershipData(GetRequestingAgentID(remoteClient), membershipArray);
+ eq.GroupMembershipData(GetRequestingAgentID(remoteClient), dataForClientID, membershipArray);
remoteClient.RefreshGroupMembership();
}
--
cgit v1.1