diff options
author | E. Allen Soard | 2011-05-06 21:22:06 -0700 |
---|---|---|
committer | Melanie | 2011-05-09 03:14:48 +0100 |
commit | 279ed08de17d05cf7825225379398508facbec60 (patch) | |
tree | ebb8969a2c198c8737783018f6a38872c6566250 /OpenSim/Region | |
parent | Adds an optional module to enforce prim limits on a given parcel Takes into a... (diff) | |
download | opensim-SC_OLD-279ed08de17d05cf7825225379398508facbec60.zip opensim-SC_OLD-279ed08de17d05cf7825225379398508facbec60.tar.gz opensim-SC_OLD-279ed08de17d05cf7825225379398508facbec60.tar.bz2 opensim-SC_OLD-279ed08de17d05cf7825225379398508facbec60.tar.xz |
Incremental patch to add config options to enable/disable the prim limits module to OpenSim.ini. EnforcePrimLimits is set to false by default to emulate the current behavior.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 0aee191..dd02bc7 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -56,13 +56,23 @@ namespace OpenSim.Region.OptionalModules | |||
56 | { | 56 | { |
57 | protected IDialogModule m_dialogModule; | 57 | protected IDialogModule m_dialogModule; |
58 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 58 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | private bool m_enabled; | |
60 | |||
60 | public string Name { get { return "Prim Limits Module"; } } | 61 | public string Name { get { return "Prim Limits Module"; } } |
61 | 62 | ||
62 | public Type ReplaceableInterface { get { return null; } } | 63 | public Type ReplaceableInterface { get { return null; } } |
63 | 64 | ||
64 | public void Initialise(IConfigSource source) | 65 | public void Initialise(IConfigSource source) |
65 | { | 66 | { |
67 | IConfig moduleConfig = source.Configs["PrimLimitsModule"]; | ||
68 | if (moduleConfig != null) | ||
69 | { | ||
70 | this.m_enabled = moduleConfig.GetBoolean("EnforcePrimLimits", false); | ||
71 | } | ||
72 | else | ||
73 | { | ||
74 | this.m_enabled = false; | ||
75 | } | ||
66 | m_log.DebugFormat("[PRIM LIMITS]: INITIALIZED MODULE"); | 76 | m_log.DebugFormat("[PRIM LIMITS]: INITIALIZED MODULE"); |
67 | } | 77 | } |
68 | 78 | ||
@@ -73,6 +83,10 @@ namespace OpenSim.Region.OptionalModules | |||
73 | 83 | ||
74 | public void AddRegion(Scene scene) | 84 | public void AddRegion(Scene scene) |
75 | { | 85 | { |
86 | if(!m_enabled) | ||
87 | { | ||
88 | return; | ||
89 | } | ||
76 | scene.Permissions.OnRezObject += CanRezObject; | 90 | scene.Permissions.OnRezObject += CanRezObject; |
77 | scene.Permissions.OnObjectEntry += CanObjectEnter; | 91 | scene.Permissions.OnObjectEntry += CanObjectEnter; |
78 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 92 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
@@ -81,6 +95,10 @@ namespace OpenSim.Region.OptionalModules | |||
81 | 95 | ||
82 | public void RemoveRegion(Scene scene) | 96 | public void RemoveRegion(Scene scene) |
83 | { | 97 | { |
98 | if(m_enabled) | ||
99 | { | ||
100 | return; | ||
101 | } | ||
84 | scene.Permissions.OnRezObject -= CanRezObject; | 102 | scene.Permissions.OnRezObject -= CanRezObject; |
85 | scene.Permissions.OnObjectEntry -= CanObjectEnter; | 103 | scene.Permissions.OnObjectEntry -= CanObjectEnter; |
86 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; | 104 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; |