From e041f09750419f60c819ee7e7a99044fe43a811c Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 6 Sep 2012 11:45:52 +0100 Subject: refactoring to allow Scene.GetLandData to accept Vector3 as an argument. Note that the prior work on LSL_Vector implicit operators means one does not need to explicitly cast a LSL_Vector to Vector3 --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a2d553d..ff3d3af 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4334,6 +4334,16 @@ namespace OpenSim.Region.Framework.Scenes return LandChannel.GetLandObject(x, y).LandData; } + /// + /// Get LandData by position. + /// + /// + /// + public LandData GetLandData(Vector3 pos) + { + return GetLandData(pos.X, pos.Y); + } + public LandData GetLandData(uint x, uint y) { m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y); -- cgit v1.1 From 783ee949ea9b9bfe309e542a74bb0712f3b65d00 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 8 Sep 2012 13:48:07 +0100 Subject: implementing per-region configuration of limits on the number of prims one can have in a linkset Applied with changes - patch was based on a repo different from core Signed-off-by: Melanie --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++++++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ff3d3af..c2c0b96 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -123,6 +123,11 @@ namespace OpenSim.Region.Framework.Scenes /// public float m_maxPhys = 10; + /// + /// Max prims an object will hold + /// + public int m_linksetCapacity = 0; + public bool m_clampPrimSize; public bool m_trustBinaries; public bool m_allowScriptCrossings; @@ -772,6 +777,12 @@ namespace OpenSim.Region.Framework.Scenes m_clampPrimSize = true; } + m_linksetCapacity = startupConfig.GetInt("LinksetPrims", m_linksetCapacity); + if (RegionInfo.LinksetCapacity > 0) + { + m_linksetCapacity = RegionInfo.LinksetCapacity; + } + m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete", m_useTrashOnDelete); m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b4a155e..e528288 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2014,6 +2014,24 @@ namespace OpenSim.Region.Framework.Scenes if (objectGroup == this) return; + // If the configured linkset capacity is greater than zero, + // and the new linkset would have a prim count higher than this + // value, do not link it. + if (m_scene.m_linksetCapacity > 0 && + (PrimCount + objectGroup.PrimCount) > + m_scene.m_linksetCapacity) + { + m_log.DebugFormat( + "[SCENE OBJECT GROUP]: Cannot link group with root" + + " part {0}, {1} ({2} prims) to group with root part" + + " {3}, {4} ({5} prims) because the new linkset" + + " would exceed the configured maximum of {6}", + objectGroup.RootPart.Name, objectGroup.RootPart.UUID, + objectGroup.PrimCount, RootPart.Name, RootPart.UUID, + PrimCount, m_scene.m_linksetCapacity); + return; + } + // 'linkPart' == the root of the group being linked into this group SceneObjectPart linkPart = objectGroup.m_rootPart; -- cgit v1.1