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 <melanie@t-data.com>
integration
SignpostMarv 2012-09-08 13:48:07 +01:00 committed by Melanie
parent e041f09750
commit 783ee949ea
5 changed files with 57 additions and 1 deletions

View File

@ -126,6 +126,7 @@ namespace OpenSim.Framework
private int m_physPrimMax = 0;
private bool m_clampPrimSize = false;
private int m_objectCapacity = 0;
private int m_linksetCapacity = 0;
private int m_agentCapacity = 0;
private string m_regionType = String.Empty;
private RegionLightShareData m_windlight = new RegionLightShareData();
@ -317,6 +318,11 @@ namespace OpenSim.Framework
get { return m_objectCapacity; }
}
public int LinksetCapacity
{
get { return m_linksetCapacity; }
}
public int AgentCapacity
{
get { return m_agentCapacity; }
@ -654,6 +660,9 @@ namespace OpenSim.Framework
m_objectCapacity = config.GetInt("MaxPrims", 15000);
allKeys.Remove("MaxPrims");
m_linksetCapacity = config.GetInt("LinksetPrims", 0);
allKeys.Remove("LinksetPrims");
#endregion
@ -709,6 +718,9 @@ namespace OpenSim.Framework
if (m_objectCapacity != 0)
config.Set("MaxPrims", m_objectCapacity);
if (m_linksetCapacity != 0)
config.Set("LinksetPrims", m_linksetCapacity);
if (m_agentCapacity != 0)
config.Set("MaxAgents", m_agentCapacity);
@ -804,6 +816,9 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max objects this sim will hold", m_objectCapacity.ToString(), true);
configMember.addConfigurationOption("linkset_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max prims an object will hold", m_linksetCapacity.ToString(), true);
configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max avatars this sim will hold", m_agentCapacity.ToString(), true);
@ -922,6 +937,9 @@ namespace OpenSim.Framework
case "object_capacity":
m_objectCapacity = (int)configuration_result;
break;
case "linkset_capacity":
m_linksetCapacity = (int)configuration_result;
break;
case "agent_capacity":
m_agentCapacity = (int)configuration_result;
break;
@ -1052,4 +1070,4 @@ namespace OpenSim.Framework
return kvp;
}
}
}
}

View File

@ -123,6 +123,11 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public float m_maxPhys = 10;
/// <summary>
/// Max prims an object will hold
/// </summary>
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);

View File

@ -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;

View File

@ -107,6 +107,11 @@
;; If a viewer attempts to rez a prim larger than the non-physical or physical prim max, clamp the dimensions to the appropriate maximum
;; This can be overriden in the region config file.
; ClampPrimSize = false
;# {LinksetPrims} {} {Max prims an object will hold?} {} 0
;; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero.
;; This can be overriden in the region config file.
; LinksetPrims = 0
;# {AllowScriptCrossing} {} {Allow scripts to cross into this region} {true false} true
;; Allow scripts to keep running when they cross region boundaries, rather than being restarted. State is reloaded on the destination region.

View File

@ -94,6 +94,10 @@
; If a viewer attempts to rez a prim larger than the non-physical or physical prim max, clamp the dimensions to the appropriate maximum
; This can be overriden in the region config file.
ClampPrimSize = false
; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero.
; This can be overriden in the region config file.
LinksetPrims = 0
; Allow scripts to keep running when they cross region boundaries, rather than being restarted. State is reloaded on the destination region.
; This only applies when crossing to a region running in a different simulator.