diff options
author | Melanie Thielker | 2009-06-23 22:11:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-06-23 22:11:34 +0000 |
commit | 41b8e2de9ed57fee4b1cd318696ed444913ef2bf (patch) | |
tree | e359c88d8530e2ac9ffa0638ff54fd431bc4d734 | |
parent | Can I be this dumb? (diff) | |
download | opensim-SC-41b8e2de9ed57fee4b1cd318696ed444913ef2bf.zip opensim-SC-41b8e2de9ed57fee4b1cd318696ed444913ef2bf.tar.gz opensim-SC-41b8e2de9ed57fee4b1cd318696ed444913ef2bf.tar.bz2 opensim-SC-41b8e2de9ed57fee4b1cd318696ed444913ef2bf.tar.xz |
Also fix group role membership packet sizes to stay safely below MTU
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7a263b1..cda4d49 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -8658,6 +8658,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8658 | List<GroupMembersData> members = | 8658 | List<GroupMembersData> members = |
8659 | m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); | 8659 | m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); |
8660 | 8660 | ||
8661 | int memberCount = members.Count; | ||
8662 | |||
8661 | while (true) | 8663 | while (true) |
8662 | { | 8664 | { |
8663 | int blockCount = members.Count; | 8665 | int blockCount = members.Count; |
@@ -8679,7 +8681,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8679 | groupMembersRequestPacket.GroupData.GroupID; | 8681 | groupMembersRequestPacket.GroupData.GroupID; |
8680 | groupMembersReply.GroupData.RequestID = | 8682 | groupMembersReply.GroupData.RequestID = |
8681 | groupMembersRequestPacket.GroupData.RequestID; | 8683 | groupMembersRequestPacket.GroupData.RequestID; |
8682 | groupMembersReply.GroupData.MemberCount = members.Count; | 8684 | groupMembersReply.GroupData.MemberCount = memberCount; |
8683 | 8685 | ||
8684 | for (int i = 0 ; i < blockCount ; i++) | 8686 | for (int i = 0 ; i < blockCount ; i++) |
8685 | { | 8687 | { |
@@ -8790,40 +8792,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8790 | 8792 | ||
8791 | if (m_GroupsModule != null) | 8793 | if (m_GroupsModule != null) |
8792 | { | 8794 | { |
8793 | GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply); | ||
8794 | groupRoleMembersReply.AgentData = | ||
8795 | new GroupRoleMembersReplyPacket.AgentDataBlock(); | ||
8796 | groupRoleMembersReply.AgentData.AgentID = | ||
8797 | AgentId; | ||
8798 | groupRoleMembersReply.AgentData.GroupID = | ||
8799 | groupRoleMembersRequest.GroupData.GroupID; | ||
8800 | groupRoleMembersReply.AgentData.RequestID = | ||
8801 | groupRoleMembersRequest.GroupData.RequestID; | ||
8802 | |||
8803 | List<GroupRoleMembersData> mappings = | 8795 | List<GroupRoleMembersData> mappings = |
8804 | m_GroupsModule.GroupRoleMembersRequest(this, | 8796 | m_GroupsModule.GroupRoleMembersRequest(this, |
8805 | groupRoleMembersRequest.GroupData.GroupID); | 8797 | groupRoleMembersRequest.GroupData.GroupID); |
8806 | |||
8807 | groupRoleMembersReply.AgentData.TotalPairs = | ||
8808 | (uint)mappings.Count; | ||
8809 | 8798 | ||
8810 | groupRoleMembersReply.MemberData = | 8799 | int mappingsCount = mappings.Count; |
8811 | new GroupRoleMembersReplyPacket.MemberDataBlock[mappings.Count]; | ||
8812 | 8800 | ||
8813 | int i = 0; | 8801 | while (mappings.Count > 0) |
8814 | foreach (GroupRoleMembersData d in mappings) | ||
8815 | { | 8802 | { |
8816 | groupRoleMembersReply.MemberData[i] = | 8803 | int pairs = mappings.Count; |
8817 | new GroupRoleMembersReplyPacket.MemberDataBlock(); | 8804 | if (pairs > 32) |
8805 | pairs = 32; | ||
8806 | |||
8807 | GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply); | ||
8808 | groupRoleMembersReply.AgentData = | ||
8809 | new GroupRoleMembersReplyPacket.AgentDataBlock(); | ||
8810 | groupRoleMembersReply.AgentData.AgentID = | ||
8811 | AgentId; | ||
8812 | groupRoleMembersReply.AgentData.GroupID = | ||
8813 | groupRoleMembersRequest.GroupData.GroupID; | ||
8814 | groupRoleMembersReply.AgentData.RequestID = | ||
8815 | groupRoleMembersRequest.GroupData.RequestID; | ||
8816 | |||
8817 | groupRoleMembersReply.AgentData.TotalPairs = | ||
8818 | (uint)mappingsCount; | ||
8819 | |||
8820 | groupRoleMembersReply.MemberData = | ||
8821 | new GroupRoleMembersReplyPacket.MemberDataBlock[pairs]; | ||
8822 | |||
8823 | for (int i = 0 ; i < pairs ; i++) | ||
8824 | { | ||
8825 | GroupRoleMembersData d = mappings[0]; | ||
8826 | mappings.RemoveAt(0); | ||
8818 | 8827 | ||
8819 | groupRoleMembersReply.MemberData[i].RoleID = | 8828 | groupRoleMembersReply.MemberData[i] = |
8820 | d.RoleID; | 8829 | new GroupRoleMembersReplyPacket.MemberDataBlock(); |
8821 | groupRoleMembersReply.MemberData[i].MemberID = | ||
8822 | d.MemberID; | ||
8823 | i++; | ||
8824 | } | ||
8825 | 8830 | ||
8826 | OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task); | 8831 | groupRoleMembersReply.MemberData[i].RoleID = |
8832 | d.RoleID; | ||
8833 | groupRoleMembersReply.MemberData[i].MemberID = | ||
8834 | d.MemberID; | ||
8835 | } | ||
8836 | |||
8837 | OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task); | ||
8838 | } | ||
8827 | } | 8839 | } |
8828 | break; | 8840 | break; |
8829 | 8841 | ||