aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs89
1 files changed, 65 insertions, 24 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 12f6fbd..16cb4ac 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2755,29 +2755,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2755 2755
2756 public void SendGroupMembership(GroupMembershipData[] GroupMembership) 2756 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
2757 { 2757 {
2758 m_groupPowers.Clear();
2759 2758
2759 // maybe removed in future, use SendAgentGroupDataUpdate instead ( but make sure to update groupPowers )
2760 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); 2760 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
2761 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; 2761 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
2762 for (int i = 0; i < GroupMembership.Length; i++)
2763 {
2764 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
2765 2762
2766 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); 2763 lock(m_groupPowers)
2767 Group.AcceptNotices = GroupMembership[i].AcceptNotices; 2764 {
2768 Group.Contribution = GroupMembership[i].Contribution; 2765 m_groupPowers.Clear();
2769 Group.GroupID = GroupMembership[i].GroupID;
2770 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
2771 Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName);
2772 Group.GroupPowers = GroupMembership[i].GroupPowers;
2773 Groups[i] = Group;
2774 2766
2767 for (int i = 0; i < GroupMembership.Length; i++)
2768 {
2769 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
2775 2770
2771 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
2772 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
2773 Group.Contribution = GroupMembership[i].Contribution;
2774 Group.GroupID = GroupMembership[i].GroupID;
2775 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
2776 Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName);
2777 Group.GroupPowers = GroupMembership[i].GroupPowers;
2778 Groups[i] = Group;
2779 }
2776 } 2780 }
2781
2777 Groupupdate.GroupData = Groups; 2782 Groupupdate.GroupData = Groups;
2778 Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); 2783 Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock();
2779 Groupupdate.AgentData.AgentID = AgentId; 2784 Groupupdate.AgentData.AgentID = AgentId;
2780 2785
2781 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); 2786 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
2782 try 2787 try
2783 { 2788 {
@@ -5639,9 +5644,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5639 if (groupID == ActiveGroupId) 5644 if (groupID == ActiveGroupId)
5640 return ActiveGroupPowers; 5645 return ActiveGroupPowers;
5641 5646
5642 if (m_groupPowers.ContainsKey(groupID)) 5647 lock(m_groupPowers)
5643 return m_groupPowers[groupID]; 5648 {
5644 5649 if (m_groupPowers.ContainsKey(groupID))
5650 return m_groupPowers[groupID];
5651 }
5645 return 0; 5652 return 0;
5646 } 5653 }
5647 5654
@@ -12952,23 +12959,57 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12952 12959
12953 public void RefreshGroupMembership() 12960 public void RefreshGroupMembership()
12954 { 12961 {
12955 if (m_GroupsModule != null) 12962 lock(m_groupPowers)
12956 { 12963 {
12957 GroupMembershipData[] GroupMembership = 12964 if (m_GroupsModule != null)
12965 {
12966 GroupMembershipData[] GroupMembership =
12958 m_GroupsModule.GetMembershipData(AgentId); 12967 m_GroupsModule.GetMembershipData(AgentId);
12959 12968
12960 m_groupPowers.Clear(); 12969 m_groupPowers.Clear();
12961 12970
12962 if (GroupMembership != null) 12971 if (GroupMembership != null)
12963 {
12964 for (int i = 0; i < GroupMembership.Length; i++)
12965 { 12972 {
12966 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; 12973 for (int i = 0; i < GroupMembership.Length; i++)
12974 {
12975 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
12976 }
12967 } 12977 }
12968 } 12978 }
12969 } 12979 }
12970 } 12980 }
12971 12981
12982 public void UpdateGroupMembership(GroupMembershipData[] data)
12983 {
12984 lock(m_groupPowers)
12985 {
12986 m_groupPowers.Clear();
12987
12988 if (data != null)
12989 {
12990 for (int i = 0; i < data.Length; i++)
12991 m_groupPowers[data[i].GroupID] = data[i].GroupPowers;
12992 }
12993 }
12994 }
12995
12996 public void GroupMembershipRemove(UUID GroupID)
12997 {
12998 lock(m_groupPowers)
12999 {
13000 if(m_groupPowers.ContainsKey(GroupID))
13001 m_groupPowers.Remove(GroupID);
13002 }
13003 }
13004
13005 public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
13006 {
13007 lock(m_groupPowers)
13008 {
13009 m_groupPowers[GroupID] = GroupPowers;
13010 }
13011 }
13012
12972 public string Report() 13013 public string Report()
12973 { 13014 {
12974 return m_udpClient.GetStats(); 13015 return m_udpClient.GetStats();