Fix up handling of the estate dialog to prevent duplication of ban list names.

Allow more than 61 names in ban list without crashing the viewer.
avinationmerge
Melanie 2011-05-15 14:55:36 +02:00
parent 37a7b87862
commit 6bac16fd88
2 changed files with 47 additions and 30 deletions

View File

@ -4372,8 +4372,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (bl[i].BannedUserID == UUID.Zero) if (bl[i].BannedUserID == UUID.Zero)
continue; continue;
BannedUsers.Add(bl[i].BannedUserID); BannedUsers.Add(bl[i].BannedUserID);
}
if (BannedUsers.Count >= 50 || (i == (bl.Length - 1) && BannedUsers.Count > 0))
{
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
packet.AgentData.TransactionID = UUID.Random(); packet.AgentData.TransactionID = UUID.Random();
packet.AgentData.AgentID = AgentId; packet.AgentData.AgentID = AgentId;
@ -4383,11 +4384,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count]; EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
for (int i = 0; i < (6 + BannedUsers.Count); i++) int j;
for (j = 0; j < (6 + BannedUsers.Count); j++)
{ {
returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); returnblock[j] = new EstateOwnerMessagePacket.ParamListBlock();
} }
int j = 0; j = 0;
returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
@ -4401,8 +4403,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
returnblock[j].Parameter = banned.GetBytes(); j++; returnblock[j].Parameter = banned.GetBytes(); j++;
} }
packet.ParamList = returnblock; packet.ParamList = returnblock;
packet.Header.Reliable = false; packet.Header.Reliable = true;
OutPacket(packet, ThrottleOutPacketType.Task); OutPacket(packet, ThrottleOutPacketType.Task);
BannedUsers.Clear();
}
}
} }
public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)

View File

@ -62,8 +62,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
#region Packet Data Responders #region Packet Data Responders
private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice)
{
sendDetailedEstateData(remote_client, invoice);
sendEstateLists(remote_client, invoice);
}
private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
{ {
m_log.DebugFormat("[ESTATE]: Invoice is {0}", invoice.ToString());
uint sun = 0; uint sun = 0;
if (!Scene.RegionInfo.EstateSettings.UseGlobalTime) if (!Scene.RegionInfo.EstateSettings.UseGlobalTime)
@ -83,7 +90,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
Scene.RegionInfo.RegionSettings.Covenant, Scene.RegionInfo.RegionSettings.Covenant,
Scene.RegionInfo.EstateSettings.AbuseEmail, Scene.RegionInfo.EstateSettings.AbuseEmail,
estateOwner); estateOwner);
}
private void sendEstateLists(IClientAPI remote_client, UUID invoice)
{
remote_client.SendEstateList(invoice, remote_client.SendEstateList(invoice,
(int)Constants.EstateAccessCodex.EstateManagers, (int)Constants.EstateAccessCodex.EstateManagers,
Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers,
@ -1121,7 +1131,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void EventManager_OnNewClient(IClientAPI client) private void EventManager_OnNewClient(IClientAPI client)
{ {
client.OnDetailedEstateDataRequest += sendDetailedEstateData; client.OnDetailedEstateDataRequest += clientSendDetailedEstateData;
client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler; client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
// client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture; // client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture; client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture;