mantis 8558: send sane values for Agents and objects capability (max hard limit)

0.9.1.0-post-fixes
UbitUmarov 2019-07-06 20:49:00 +01:00
parent 03abb970f4
commit d372309e3c
3 changed files with 15 additions and 28 deletions

View File

@ -33,7 +33,7 @@ namespace OpenSim.Framework
{
public float billableFactor;
public uint estateID;
public byte maxAgents;
public int maxAgents;
public float objectBonusFactor;
public uint parentEstateID;
public int pricePerMeter;
@ -48,5 +48,7 @@ namespace OpenSim.Framework
public float waterHeight;
public string simName;
public string regionType;
public int AgentCapacity;
public int ObjectsCapacity;
}
}

View File

@ -6347,7 +6347,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
rinfopack.AgentData.SessionID = SessionId;
rinfoblk.BillableFactor = args.billableFactor;
rinfoblk.EstateID = args.estateID;
rinfoblk.MaxAgents = args.maxAgents;
rinfoblk.MaxAgents = (byte)args.maxAgents;
rinfoblk.ObjectBonusFactor = args.objectBonusFactor;
rinfoblk.ParentEstateID = args.parentEstateID;
rinfoblk.PricePerMeter = args.pricePerMeter;
@ -6363,9 +6363,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
rinfoblk.SimName = Utils.StringToBytes(args.simName);
rinfopack.RegionInfo2 = new RegionInfoPacket.RegionInfo2Block();
rinfopack.RegionInfo2.HardMaxAgents = uint.MaxValue;
rinfopack.RegionInfo2.HardMaxObjects = uint.MaxValue;
rinfopack.RegionInfo2.MaxAgents32 = uint.MaxValue;
rinfopack.RegionInfo2.HardMaxAgents = (uint)args.AgentCapacity;
rinfopack.RegionInfo2.HardMaxObjects = (uint)args.ObjectsCapacity;
rinfopack.RegionInfo2.MaxAgents32 = (uint)args.maxAgents;
rinfopack.RegionInfo2.ProductName = Util.StringToBytes256(args.regionType);
rinfopack.RegionInfo2.ProductSKU = Utils.EmptyBytes;
@ -8013,7 +8013,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest);
AddLocalPacketHandler(PacketType.RequestXfer, HandleRequestXfer);
AddLocalPacketHandler(PacketType.SendXferPacket, HandleSendXferPacket);
AddLocalPacketHandler(PacketType.ConfirmXferPacket, HandleConfirmXferPacket);
AddLocalPacketHandler(PacketType.ConfirmXferPacket, HandleConfirmXferPacket, false);
AddLocalPacketHandler(PacketType.AbortXfer, HandleAbortXfer);
AddLocalPacketHandler(PacketType.CreateInventoryFolder, HandleCreateInventoryFolder);
AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder);
@ -10636,12 +10636,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
RequestXferPacket xferReq = (RequestXferPacket)Pack;
RequestXfer handlerRequestXfer = OnRequestXfer;
if (handlerRequestXfer != null)
{
handlerRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename));
}
OnRequestXfer?.Invoke(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename));
return true;
}
@ -10649,11 +10644,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
XferReceive handlerXferReceive = OnXferReceive;
if (handlerXferReceive != null)
{
handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
}
OnXferReceive?.Invoke(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
return true;
}
@ -10661,23 +10652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
ConfirmXfer handlerConfirmXfer = OnConfirmXfer;
if (handlerConfirmXfer != null)
{
handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
}
OnConfirmXfer?.Invoke(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
return true;
}
private bool HandleAbortXfer(IClientAPI sender, Packet Pack)
{
AbortXferPacket abortXfer = (AbortXferPacket)Pack;
AbortXfer handlerAbortXfer = OnAbortXfer;
if (handlerAbortXfer != null)
{
handlerAbortXfer(this, abortXfer.XferID.ID);
}
OnAbortXfer?.Invoke(this, abortXfer.XferID.ID);
return true;
}

View File

@ -1404,7 +1404,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs();
args.billableFactor = Scene.RegionInfo.EstateSettings.BillableFactor;
args.estateID = Scene.RegionInfo.EstateSettings.EstateID;
args.maxAgents = (byte)Scene.RegionInfo.RegionSettings.AgentLimit;
args.maxAgents = Scene.RegionInfo.RegionSettings.AgentLimit;
args.objectBonusFactor = (float)Scene.RegionInfo.RegionSettings.ObjectBonus;
args.parentEstateID = Scene.RegionInfo.EstateSettings.ParentEstateID;
args.pricePerMeter = Scene.RegionInfo.EstateSettings.PricePerMeter;
@ -1419,6 +1419,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight;
args.simName = Scene.RegionInfo.RegionName;
args.regionType = Scene.RegionInfo.RegionType;
args.AgentCapacity = Scene.RegionInfo.AgentCapacity;
args.ObjectsCapacity = Scene.RegionInfo.ObjectCapacity;
remote_client.SendRegionInfoToEstateMenu(args);
}