From 0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 11 Jun 2008 17:31:43 +0000 Subject: *Parcel Prim Count Maximums moved to their own functions so modules can override the default method of calculating how many prims a parcel can have. --- .../Environment/Modules/World/Land/LandObject.cs | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World/Land/LandObject.cs') diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index f5b1a1d..2ff48cc 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) -- cgit v1.1