From e57d3edf6f483013461888c6acb65312101ab0eb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 Aug 2016 21:36:41 +0100 Subject: [PATCH] make sure all new scenepresences have fresh groups information at creation time (grouptitle missing but not that needed at that point) (use direct calls exactly where we want things to happen), reusing a funtion name to rename later --- OpenSim/Addons/Groups/GroupsModule.cs | 2 +- .../ClientStack/Linden/UDP/LLClientView.cs | 23 ++++++++++++++++++- .../Region/Framework/Scenes/ScenePresence.cs | 2 ++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index b6bf5f1711..73fc22ce4e 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -1284,7 +1284,7 @@ namespace OpenSim.Groups GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); - remoteClient.RefreshGroupMembership(); + remoteClient.UpdateGroupMembership(membershipArray); remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 26fc85e7fe..25ecc96395 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -13148,11 +13148,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP { lock(m_groupPowers) { + GroupMembershipData activeMembership = null; if (m_GroupsModule != null) { GroupMembershipData[] GroupMembership = m_GroupsModule.GetMembershipData(AgentId); - + m_groupPowers.Clear(); if (GroupMembership != null) @@ -13162,6 +13163,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; } } + + activeMembership = m_GroupsModule.GetActiveMembershipData(AgentId); + if(activeMembership != null) + { + if(!m_groupPowers.ContainsKey(activeMembership.GroupID)) + activeMembership = null; + else + { + m_activeGroupID = activeMembership.GroupID; + m_activeGroupName = activeMembership.GroupName; + m_activeGroupPowers = ActiveGroupPowers; + } + } + } + + if(activeMembership == null) + { + m_activeGroupID = UUID.Zero; + m_activeGroupName = ""; + m_activeGroupPowers = 0; } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c55d904535..90b0f381b4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1094,6 +1094,8 @@ namespace OpenSim.Region.Framework.Scenes m_LandingPointBehavior = LandingPointBehavior.SL; } + ControllingClient.RefreshGroupMembership(); + } private float lastHealthSent = 0;