Also fix group role membership packet sizes to stay safely below MTU
parent
8cf16f6ea4
commit
41b8e2de9e
|
@ -8658,6 +8658,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
List<GroupMembersData> members =
|
List<GroupMembersData> members =
|
||||||
m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID);
|
m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID);
|
||||||
|
|
||||||
|
int memberCount = members.Count;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
int blockCount = members.Count;
|
int blockCount = members.Count;
|
||||||
|
@ -8679,7 +8681,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
groupMembersRequestPacket.GroupData.GroupID;
|
groupMembersRequestPacket.GroupData.GroupID;
|
||||||
groupMembersReply.GroupData.RequestID =
|
groupMembersReply.GroupData.RequestID =
|
||||||
groupMembersRequestPacket.GroupData.RequestID;
|
groupMembersRequestPacket.GroupData.RequestID;
|
||||||
groupMembersReply.GroupData.MemberCount = members.Count;
|
groupMembersReply.GroupData.MemberCount = memberCount;
|
||||||
|
|
||||||
for (int i = 0 ; i < blockCount ; i++)
|
for (int i = 0 ; i < blockCount ; i++)
|
||||||
{
|
{
|
||||||
|
@ -8790,40 +8792,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
if (m_GroupsModule != null)
|
if (m_GroupsModule != null)
|
||||||
{
|
{
|
||||||
GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply);
|
|
||||||
groupRoleMembersReply.AgentData =
|
|
||||||
new GroupRoleMembersReplyPacket.AgentDataBlock();
|
|
||||||
groupRoleMembersReply.AgentData.AgentID =
|
|
||||||
AgentId;
|
|
||||||
groupRoleMembersReply.AgentData.GroupID =
|
|
||||||
groupRoleMembersRequest.GroupData.GroupID;
|
|
||||||
groupRoleMembersReply.AgentData.RequestID =
|
|
||||||
groupRoleMembersRequest.GroupData.RequestID;
|
|
||||||
|
|
||||||
List<GroupRoleMembersData> mappings =
|
List<GroupRoleMembersData> mappings =
|
||||||
m_GroupsModule.GroupRoleMembersRequest(this,
|
m_GroupsModule.GroupRoleMembersRequest(this,
|
||||||
groupRoleMembersRequest.GroupData.GroupID);
|
groupRoleMembersRequest.GroupData.GroupID);
|
||||||
|
|
||||||
groupRoleMembersReply.AgentData.TotalPairs =
|
int mappingsCount = mappings.Count;
|
||||||
(uint)mappings.Count;
|
|
||||||
|
|
||||||
groupRoleMembersReply.MemberData =
|
while (mappings.Count > 0)
|
||||||
new GroupRoleMembersReplyPacket.MemberDataBlock[mappings.Count];
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
foreach (GroupRoleMembersData d in mappings)
|
|
||||||
{
|
{
|
||||||
groupRoleMembersReply.MemberData[i] =
|
int pairs = mappings.Count;
|
||||||
new GroupRoleMembersReplyPacket.MemberDataBlock();
|
if (pairs > 32)
|
||||||
|
pairs = 32;
|
||||||
|
|
||||||
groupRoleMembersReply.MemberData[i].RoleID =
|
GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply);
|
||||||
d.RoleID;
|
groupRoleMembersReply.AgentData =
|
||||||
groupRoleMembersReply.MemberData[i].MemberID =
|
new GroupRoleMembersReplyPacket.AgentDataBlock();
|
||||||
d.MemberID;
|
groupRoleMembersReply.AgentData.AgentID =
|
||||||
i++;
|
AgentId;
|
||||||
|
groupRoleMembersReply.AgentData.GroupID =
|
||||||
|
groupRoleMembersRequest.GroupData.GroupID;
|
||||||
|
groupRoleMembersReply.AgentData.RequestID =
|
||||||
|
groupRoleMembersRequest.GroupData.RequestID;
|
||||||
|
|
||||||
|
groupRoleMembersReply.AgentData.TotalPairs =
|
||||||
|
(uint)mappingsCount;
|
||||||
|
|
||||||
|
groupRoleMembersReply.MemberData =
|
||||||
|
new GroupRoleMembersReplyPacket.MemberDataBlock[pairs];
|
||||||
|
|
||||||
|
for (int i = 0 ; i < pairs ; i++)
|
||||||
|
{
|
||||||
|
GroupRoleMembersData d = mappings[0];
|
||||||
|
mappings.RemoveAt(0);
|
||||||
|
|
||||||
|
groupRoleMembersReply.MemberData[i] =
|
||||||
|
new GroupRoleMembersReplyPacket.MemberDataBlock();
|
||||||
|
|
||||||
|
groupRoleMembersReply.MemberData[i].RoleID =
|
||||||
|
d.RoleID;
|
||||||
|
groupRoleMembersReply.MemberData[i].MemberID =
|
||||||
|
d.MemberID;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task);
|
||||||
}
|
}
|
||||||
|
|
||||||
OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue