diff options
author | UbitUmarov | 2016-07-01 19:20:04 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-01 19:20:04 +0100 |
commit | 3af437c8bcd8590295f7cf6927cde0bcff9fa3b7 (patch) | |
tree | 502b143934fbfe6cc1dc67a20a61d5ec73f90022 /OpenSim | |
parent | save one call to grid to get agent groups powers (xmlrpcgoups only for now (diff) | |
download | opensim-SC_OLD-3af437c8bcd8590295f7cf6927cde0bcff9fa3b7.zip opensim-SC_OLD-3af437c8bcd8590295f7cf6927cde0bcff9fa3b7.tar.gz opensim-SC_OLD-3af437c8bcd8590295f7cf6927cde0bcff9fa3b7.tar.bz2 opensim-SC_OLD-3af437c8bcd8590295f7cf6927cde0bcff9fa3b7.tar.xz |
cleanup a bit
Diffstat (limited to 'OpenSim')
4 files changed, 2 insertions, 91 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 9a1cef4..cc614f3 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -579,12 +579,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
579 | Enqueue(item, avatarID); | 579 | Enqueue(item, avatarID); |
580 | } | 580 | } |
581 | 581 | ||
582 | public void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) | ||
583 | { | ||
584 | OSD item = EventQueueHelper.GroupMembership(groupUpdate); | ||
585 | Enqueue(item, avatarID); | ||
586 | } | ||
587 | |||
588 | public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) | 582 | public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) |
589 | { | 583 | { |
590 | OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data); | 584 | OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 29d8b85..8beeb95 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs | |||
@@ -333,40 +333,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
333 | return chatterBoxSessionAgentListUpdates; | 333 | return chatterBoxSessionAgentListUpdates; |
334 | } | 334 | } |
335 | 335 | ||
336 | public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) | ||
337 | { | ||
338 | OSDMap groupUpdate = new OSDMap(); | ||
339 | groupUpdate.Add("message", OSD.FromString("AgentGroupDataUpdate")); | ||
340 | |||
341 | OSDMap body = new OSDMap(); | ||
342 | OSDArray agentData = new OSDArray(); | ||
343 | OSDMap agentDataMap = new OSDMap(); | ||
344 | agentDataMap.Add("AgentID", OSD.FromUUID(groupUpdatePacket.AgentData.AgentID)); | ||
345 | agentData.Add(agentDataMap); | ||
346 | body.Add("AgentData", agentData); | ||
347 | |||
348 | OSDArray groupData = new OSDArray(); | ||
349 | |||
350 | foreach (AgentGroupDataUpdatePacket.GroupDataBlock groupDataBlock in groupUpdatePacket.GroupData) | ||
351 | { | ||
352 | OSDMap groupDataMap = new OSDMap(); | ||
353 | groupDataMap.Add("ListInProfile", OSD.FromBoolean(false)); | ||
354 | groupDataMap.Add("GroupID", OSD.FromUUID(groupDataBlock.GroupID)); | ||
355 | groupDataMap.Add("GroupInsigniaID", OSD.FromUUID(groupDataBlock.GroupInsigniaID)); | ||
356 | groupDataMap.Add("Contribution", OSD.FromInteger(groupDataBlock.Contribution)); | ||
357 | groupDataMap.Add("GroupPowers", OSD.FromBinary(ulongToByteArray(groupDataBlock.GroupPowers))); | ||
358 | groupDataMap.Add("GroupName", OSD.FromString(Utils.BytesToString(groupDataBlock.GroupName))); | ||
359 | groupDataMap.Add("AcceptNotices", OSD.FromBoolean(groupDataBlock.AcceptNotices)); | ||
360 | |||
361 | groupData.Add(groupDataMap); | ||
362 | |||
363 | } | ||
364 | body.Add("GroupData", groupData); | ||
365 | groupUpdate.Add("body", body); | ||
366 | |||
367 | return groupUpdate; | ||
368 | } | ||
369 | |||
370 | public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) | 336 | public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) |
371 | { | 337 | { |
372 | OSDArray AgentData = new OSDArray(1); | 338 | OSDArray AgentData = new OSDArray(1); |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 29c4d91..22b11e6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -2756,51 +2756,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2756 | public void SendGroupMembership(GroupMembershipData[] GroupMembership) | 2756 | public void SendGroupMembership(GroupMembershipData[] GroupMembership) |
2757 | { | 2757 | { |
2758 | 2758 | ||
2759 | // maybe removed in future, use SendAgentGroupDataUpdate instead ( but make sure to update groupPowers ) | 2759 | UpdateGroupMembership(GroupMembership); |
2760 | AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); | 2760 | SendAgentGroupDataUpdate(AgentId,GroupMembership); |
2761 | AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; | ||
2762 | |||
2763 | lock(m_groupPowers) | ||
2764 | { | ||
2765 | m_groupPowers.Clear(); | ||
2766 | |||
2767 | for (int i = 0; i < GroupMembership.Length; i++) | ||
2768 | { | ||
2769 | m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; | ||
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 | } | ||
2780 | } | ||
2781 | |||
2782 | Groupupdate.GroupData = Groups; | ||
2783 | Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); | ||
2784 | Groupupdate.AgentData.AgentID = AgentId; | ||
2785 | |||
2786 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
2787 | try | ||
2788 | { | ||
2789 | if (eq != null) | ||
2790 | { | ||
2791 | eq.GroupMembership(Groupupdate, this.AgentId); | ||
2792 | } | ||
2793 | } | ||
2794 | catch (Exception ex) | ||
2795 | { | ||
2796 | m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString()); | ||
2797 | m_log.Warn("sending group membership data via UDP"); | ||
2798 | eq = null; | ||
2799 | } | ||
2800 | |||
2801 | if(eq == null) // udp if no eq | ||
2802 | OutPacket(Groupupdate, ThrottleOutPacketType.Task); | ||
2803 | |||
2804 | } | 2761 | } |
2805 | 2762 | ||
2806 | public void SendPartPhysicsProprieties(ISceneEntity entity) | 2763 | public void SendPartPhysicsProprieties(ISceneEntity entity) |
@@ -11015,7 +10972,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11015 | if (m_GroupsModule != null) | 10972 | if (m_GroupsModule != null) |
11016 | { | 10973 | { |
11017 | m_GroupsModule.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); | 10974 | m_GroupsModule.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); |
11018 | m_GroupsModule.SendAgentGroupDataUpdate(this); | ||
11019 | } | 10975 | } |
11020 | return true; | 10976 | return true; |
11021 | 10977 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 332d59c..6ed9a16 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | |||
@@ -157,11 +157,6 @@ namespace OpenSim.Tests.Common | |||
157 | AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); | 157 | AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); |
158 | } | 158 | } |
159 | 159 | ||
160 | public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) | ||
161 | { | ||
162 | AddEvent(avatarID, "GroupMembership", groupUpdate); | ||
163 | } | ||
164 | |||
165 | public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) | 160 | public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) |
166 | { | 161 | { |
167 | AddEvent(receiverAgent, "AgentGroupDataUpdate", data); | 162 | AddEvent(receiverAgent, "AgentGroupDataUpdate", data); |