From a2635e43dab05ae6985cfa73a42468225345eab0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 23 Jun 2009 14:37:51 +0000 Subject: Allow the member list of groups with more than 70 members to be viewed without crashing --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 78 ++++++++++++---------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1a43450..a5c0e45 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -8658,44 +8658,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP List members = m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); - GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply); - - groupMembersReply.AgentData = - new GroupMembersReplyPacket.AgentDataBlock(); - groupMembersReply.GroupData = - new GroupMembersReplyPacket.GroupDataBlock(); - groupMembersReply.MemberData = - new GroupMembersReplyPacket.MemberDataBlock[ - members.Count]; - - groupMembersReply.AgentData.AgentID = AgentId; - groupMembersReply.GroupData.GroupID = - groupMembersRequestPacket.GroupData.GroupID; - groupMembersReply.GroupData.RequestID = - groupMembersRequestPacket.GroupData.RequestID; - groupMembersReply.GroupData.MemberCount = members.Count; - - int i = 0; - foreach (GroupMembersData m in members) + while (true) { - groupMembersReply.MemberData[i] = - new GroupMembersReplyPacket.MemberDataBlock(); - groupMembersReply.MemberData[i].AgentID = - m.AgentID; - groupMembersReply.MemberData[i].Contribution = - m.Contribution; - groupMembersReply.MemberData[i].OnlineStatus = - Utils.StringToBytes(m.OnlineStatus); - groupMembersReply.MemberData[i].AgentPowers = - m.AgentPowers; - groupMembersReply.MemberData[i].Title = - Utils.StringToBytes(m.Title); - groupMembersReply.MemberData[i].IsOwner = - m.IsOwner; - i++; + GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply); + + groupMembersReply.AgentData = + new GroupMembersReplyPacket.AgentDataBlock(); + groupMembersReply.GroupData = + new GroupMembersReplyPacket.GroupDataBlock(); + groupMembersReply.MemberData = + new GroupMembersReplyPacket.MemberDataBlock[ + members.Count]; + + groupMembersReply.AgentData.AgentID = AgentId; + groupMembersReply.GroupData.GroupID = + groupMembersRequestPacket.GroupData.GroupID; + groupMembersReply.GroupData.RequestID = + groupMembersRequestPacket.GroupData.RequestID; + groupMembersReply.GroupData.MemberCount = members.Count; + + for (int i = 0 ; i < 60 && members.Count > 0 ; i++) + { + GroupMembersData m = members[0]; + members.RemoveAt(0); + + groupMembersReply.MemberData[i] = + new GroupMembersReplyPacket.MemberDataBlock(); + groupMembersReply.MemberData[i].AgentID = + m.AgentID; + groupMembersReply.MemberData[i].Contribution = + m.Contribution; + groupMembersReply.MemberData[i].OnlineStatus = + Utils.StringToBytes(m.OnlineStatus); + groupMembersReply.MemberData[i].AgentPowers = + m.AgentPowers; + groupMembersReply.MemberData[i].Title = + Utils.StringToBytes(m.Title); + groupMembersReply.MemberData[i].IsOwner = + m.IsOwner; + i++; + } + OutPacket(groupMembersReply, ThrottleOutPacketType.Task); + if (members.Count == 0) + break; } - - OutPacket(groupMembersReply, ThrottleOutPacketType.Task); } break; -- cgit v1.1