diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 0ece1a327b..11cc166a85 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -972,7 +972,7 @@ namespace OpenSim.Framework void sendEstateCovenantInformation(); void sendDetailedEstateData(LLUUID invoice,string estateName, uint estateID); - void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags); + void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags); void sendLandAccessListData(List avatars, uint accessFlag, int localLandID); void sendForceClientSelectObjects(List objectIDs); void sendLandObjectOwners(Dictionary ownersAndCount); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6839896fa9..47a9f53b7a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2630,7 +2630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP this.OutPacket(packet, ThrottleOutPacketType.Task); } - public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) + public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties); // TODO: don't create new blocks if recycling an old packet @@ -2654,10 +2654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP updatePacket.ParcelData.LocalID = landData.localID; if (landData.area > 0) { - updatePacket.ParcelData.MaxPrims = - Convert.ToInt32( - Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * simObjectCapacity * - Convert.ToDecimal(simObjectBonusFactor))); + updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; } else { @@ -2696,10 +2693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP updatePacket.ParcelData.SequenceID = sequence_id; if (landData.simwideArea > 0) { - updatePacket.ParcelData.SimWideMaxPrims = - Convert.ToInt32( - Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * simObjectCapacity * - Convert.ToDecimal(simObjectBonusFactor))); + updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; } else { diff --git a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs index 6c53177b96..c1f6f45ef6 100644 --- a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs @@ -42,5 +42,7 @@ namespace OpenSim.Region.Environment.Interfaces bool IsForcefulBansAllowed(); void UpdateLandObject(int localID, LandData data); void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient); + void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); + void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); } } diff --git a/OpenSim/Region/Environment/Interfaces/ILandObject.cs b/OpenSim/Region/Environment/Interfaces/ILandObject.cs index 43684938cc..750b387c23 100644 --- a/OpenSim/Region/Environment/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Environment/Interfaces/ILandObject.cs @@ -32,8 +32,14 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.Environment.Interfaces { + public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj); + public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj); + public interface ILandObject { + int getParcelMaxPrimCount(ILandObject thisObject); + int getSimulatorMaxPrimCount(ILandObject thisObject); + LandData landData { get; set; } bool[,] landBitmap { get; set; } LLUUID regionUUID { get; } @@ -57,6 +63,7 @@ namespace OpenSim.Region.Environment.Interfaces void forceUpdateLandInfo(); void setLandBitmap(bool[,] bitmap); + bool[,] basicFullRegionLandBitmap(); bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); @@ -69,5 +76,8 @@ namespace OpenSim.Region.Environment.Interfaces void addPrimToCount(SceneObjectGroup obj); void removePrimFromCount(SceneObjectGroup obj); void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); + + void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); + void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); } } diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs index 0b77b23345..b83de239dc 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs @@ -149,6 +149,22 @@ namespace OpenSim.Region.Environment.Modules.World.Land m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); } } + + public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) + { + if (m_landManagementModule != null) + { + m_landManagementModule.setParcelObjectMaxOverride(overrideDel); + } + } + + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) + { + if (m_landManagementModule != null) + { + m_landManagementModule.setSimulatorObjectMaxOverride(overrideDel); + } + } #endregion } diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 1c047966cf..984bc4e0c6 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -585,7 +585,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ResetAllLandPrimCounts(); lock (m_scene.Entities) { - foreach (EntityBase obj in m_scene.Entities.Values) + foreach (EntityBase obj in m_scene.Entities.Values) { if (obj != null) { @@ -1048,6 +1048,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land #endregion + public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) + { + foreach (LandObject obj in landList.Values) + { + obj.setParcelObjectMaxOverride(overrideDel); + } + } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) + { + } } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index f5b1a1d635..2ff48ccd19 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -116,13 +116,52 @@ namespace OpenSim.Region.Environment.Modules.World.Land return newLand; } - #endregion + + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; + static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; + public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) + { + overrideParcelMaxPrimCount = overrideDel; + } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) + { + overrideSimulatorMaxPrimCount = overrideDel; + } + + public int getParcelMaxPrimCount(ILandObject thisObject) + { + if (overrideParcelMaxPrimCount != null) + { + return overrideParcelMaxPrimCount(thisObject); + } + else + { + //Normal Calculations + return Convert.ToInt32( + Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * + Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor))); ; + } + } + public int getSimulatorMaxPrimCount(ILandObject thisObject) + { + if (overrideSimulatorMaxPrimCount != null) + { + return overrideSimulatorMaxPrimCount(thisObject); + } + else + { + //Normal Calculations + return m_scene.objectCapacity; + } + } + #endregion + #region Packet Request Handling public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) { - remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, m_scene.objectCapacity,(uint) m_scene.RegionInfo.EstateSettings.regionFlags); + remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, getParcelMaxPrimCount(this), getSimulatorMaxPrimCount(this), (uint)m_scene.RegionInfo.EstateSettings.regionFlags); } public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index b8ca482df2..a64d857e2b 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } - public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) + public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { } public void sendLandAccessListData(List avatars, uint accessFlag, int localLandID) diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index dcbbc6886e..99372fe930 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -745,7 +745,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) + public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { } public void sendLandAccessListData(List avatars, uint accessFlag, int localLandID) diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs index 04cb0b2f4b..b18c867fd7 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs @@ -5576,7 +5576,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { m_host.AddScriptLPS(1); NotImplemented("llSetInventoryPermMask"); - } + } public string llGetInventoryCreator(string item) {