From ea3e0ef8a362a103fd70f17cfc3ea76a20fac5ab Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 28 Feb 2013 14:20:07 -0800 Subject: [PATCH 1/8] Bug fix in DataSnapshot, where a var was being used before being initialized. --- .../DataSnapshot/DataSnapshotManager.cs | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 32017a8537..dd48dd5c2b 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -148,8 +148,6 @@ namespace OpenSim.Region.DataSnapshot return; } - if (m_enabled) - m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); } } @@ -163,8 +161,22 @@ namespace OpenSim.Region.DataSnapshot m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); - m_snapStore.AddScene(scene); + if (!m_servicesNotified) + { + m_hostname = scene.RegionInfo.ExternalHostName; + m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); + + //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer + new DataRequestHandler(scene, this); + + if (m_dataServices != "" && m_dataServices != "noservices") + NotifyDataServices(m_dataServices, "online"); + + m_servicesNotified = true; + } + m_scenes.Add(scene); + m_snapStore.AddScene(scene); Assembly currentasm = Assembly.GetExecutingAssembly(); @@ -189,22 +201,6 @@ namespace OpenSim.Region.DataSnapshot } } - // Must be done here because on shared modules, PostInitialise() will run - // BEFORE any scenes are registered. There is no "all scenes have been loaded" - // kind of callback because scenes may be created dynamically, so we cannot - // have that info, ever. - if (!m_servicesNotified) - { - //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer - new DataRequestHandler(m_scenes[0], this); - - m_hostname = m_scenes[0].RegionInfo.ExternalHostName; - - if (m_dataServices != "" && m_dataServices != "noservices") - NotifyDataServices(m_dataServices, "online"); - - m_servicesNotified = true; - } } public void RemoveRegion(Scene scene) From b2087add9633a0b3b1ddeaee1a40c1e16bd95314 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 28 Feb 2013 15:17:07 -0800 Subject: [PATCH 2/8] Add missing prebuild.xml dependency for System.Action2 in recent additions to ScriptEngine tests. Compiles some places but not others. --- prebuild.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/prebuild.xml b/prebuild.xml index 0e5879272e..2b8e9634e0 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -3387,6 +3387,7 @@ ../../../bin/ + From faf96f5c854a9f928797f170b07c32236a7559e3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 28 Feb 2013 23:59:26 +0000 Subject: [PATCH 3/8] minor: Log location in which simulator/robust was started. Useful information for system debugging, especially if logging and ini files locations have been changed from defaults. --- OpenSim/Region/Application/OpenSimBase.cs | 4 ++++ OpenSim/Server/Base/ServicesServerBase.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index c555915eac..137bd8199c 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -134,6 +134,10 @@ namespace OpenSim /// public OpenSimBase(IConfigSource configSource) : base() { + // FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net + // XmlConfigurator calls first accross servers. + m_log.InfoFormat("[SERVER BASE]: Starting in {0}", m_startupDirectory); + LoadConfigSettings(configSource); } diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index ecd69b0572..5aff72ac48 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -186,6 +186,10 @@ namespace OpenSim.Server.Base XmlConfigurator.Configure(); } + // FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net + // XmlConfigurator calls first accross servers. + m_log.InfoFormat("[SERVER BASE]: Starting in {0}", m_startupDirectory); + RegisterCommonAppenders(startupConfig); if (startupConfig.GetString("PIDFile", String.Empty) != String.Empty) From 1c740798b45dddb3e056b2e281fe98de6bf35143 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 1 Mar 2013 08:52:06 -0800 Subject: [PATCH 4/8] BulletSim: add parameters, code cleanup around checking and enforcing maximum velocity and angular velocity values for prims. --- .../Physics/BulletSPlugin/BSDynamics.cs | 4 +- .../Region/Physics/BulletSPlugin/BSParam.cs | 20 +++++--- .../Region/Physics/BulletSPlugin/BSPrim.cs | 47 ++++++++++++++++--- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index e6933f90bf..235cefc81b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs @@ -961,13 +961,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin // ================================================================== // Clamp high or low velocities float newVelocityLengthSq = VehicleVelocity.LengthSquared(); - if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySq) + if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySquared) { Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG VehicleVelocity /= VehicleVelocity.Length(); VehicleVelocity *= BSParam.VehicleMaxLinearVelocity; VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}", - Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySq, VehicleVelocity); + Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySquared, VehicleVelocity); } else if (newVelocityLengthSq < 0.001f) VehicleVelocity = Vector3.Zero; diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index dc57b676e5..fa581090c6 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -47,12 +47,16 @@ public static class BSParam public static float SculptLOD { get; private set; } public static int CrossingFailuresBeforeOutOfBounds { get; private set; } + public static float UpdateVelocityChangeThreshold { get; private set; } public static float MinimumObjectMass { get; private set; } public static float MaximumObjectMass { get; private set; } public static float MaxLinearVelocity { get; private set; } + public static float MaxLinearVelocitySquared { get; private set; } public static float MaxAngularVelocity { get; private set; } + public static float MaxAngularVelocitySquared { get; private set; } public static float MaxAddForceMagnitude { get; private set; } + public static float MaxAddForceMagnitudeSquared { get; private set; } public static float DensityScaleFactor { get; private set; } public static float LinearDamping { get; private set; } @@ -109,7 +113,7 @@ public static class BSParam // Vehicle parameters public static float VehicleMaxLinearVelocity { get; private set; } - public static float VehicleMaxLinearVelocitySq { get; private set; } + public static float VehicleMaxLinearVelocitySquared { get; private set; } public static float VehicleMaxAngularVelocity { get; private set; } public static float VehicleMaxAngularVelocitySq { get; private set; } public static float VehicleAngularDamping { get; private set; } @@ -265,7 +269,7 @@ public static class BSParam // The single letter parameters for the delegates are: // s = BSScene // o = BSPhysObject - // v = value (float) + // v = value (appropriate type) private static ParameterDefnBase[] ParameterDefinitions = { new ParameterDefn("MeshSculptedPrim", "Whether to create meshes for sculpties", @@ -289,6 +293,10 @@ public static class BSParam 5, (s) => { return CrossingFailuresBeforeOutOfBounds; }, (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ), + new ParameterDefn("UpdateVelocityChangeThreshold", "Change in updated velocity required before reporting change to simulator", + 0.1f, + (s) => { return UpdateVelocityChangeThreshold; }, + (s,v) => { UpdateVelocityChangeThreshold = v; } ), new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", 32f, @@ -343,16 +351,16 @@ public static class BSParam new ParameterDefn("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", 1000.0f, (s) => { return MaxLinearVelocity; }, - (s,v) => { MaxLinearVelocity = v; } ), + (s,v) => { MaxLinearVelocity = v; MaxLinearVelocitySquared = v * v; } ), new ParameterDefn("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", 1000.0f, (s) => { return MaxAngularVelocity; }, - (s,v) => { MaxAngularVelocity = v; } ), + (s,v) => { MaxAngularVelocity = v; MaxAngularVelocitySquared = v * v; } ), // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject new ParameterDefn("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", 20000.0f, (s) => { return MaxAddForceMagnitude; }, - (s,v) => { MaxAddForceMagnitude = v; } ), + (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ), // Density is passed around as 100kg/m3. This scales that to 1kg/m3. new ParameterDefn("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", 0.01f, @@ -505,7 +513,7 @@ public static class BSParam new ParameterDefn("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", 1000.0f, (s) => { return (float)VehicleMaxLinearVelocity; }, - (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySq = v * v; } ), + (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySquared = v * v; } ), new ParameterDefn("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", 12.0f, (s) => { return (float)VehicleMaxAngularVelocity; }, diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 8f660c4be5..a465613b8a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -108,6 +108,9 @@ public class BSPrim : BSPhysObject // do the actual object creation at taint time PhysicsScene.TaintedObject("BSPrim.create", delegate() { + // Make sure the object is being created with some sanity. + ExtremeSanityCheck(true /* inTaintTime */); + CreateGeomAndObject(true); CurrentCollisionFlags = PhysicsScene.PE.GetCollisionFlags(PhysBody); @@ -450,6 +453,38 @@ public class BSPrim : BSPhysObject return ret; } + // Occasionally things will fly off and really get lost. + // Find the wanderers and bring them back. + // Return 'true' if some parameter need some sanity. + private bool ExtremeSanityCheck(bool inTaintTime) + { + bool ret = false; + + uint wayOutThere = Constants.RegionSize * Constants.RegionSize; + // There have been instances of objects getting thrown way out of bounds and crashing + // the border crossing code. + if ( _position.X < -Constants.RegionSize || _position.X > wayOutThere + || _position.Y < -Constants.RegionSize || _position.Y > wayOutThere + || _position.Z < -Constants.RegionSize || _position.Z > wayOutThere) + { + _position = new OMV.Vector3(10, 10, 50); + ZeroMotion(inTaintTime); + ret = true; + } + if (_velocity.LengthSquared() > BSParam.MaxLinearVelocity) + { + _velocity = Util.ClampV(_velocity, BSParam.MaxLinearVelocity); + ret = true; + } + if (_rotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared) + { + _rotationalVelocity = Util.ClampV(_rotationalVelocity, BSParam.MaxAngularVelocity); + ret = true; + } + + return ret; + } + // Return the effective mass of the object. // The definition of this call is to return the mass of the prim. // If the simulator cares about the mass of the linkset, it will sum it itself. @@ -585,12 +620,12 @@ public class BSPrim : BSPhysObject if (VehicleController.Type == Vehicle.TYPE_NONE) { UnRegisterPreStepAction("BSPrim.Vehicle", LocalID); - PhysicsScene.AfterStep -= VehicleController.PostStep; + UnRegisterPostStepAction("BSPrim.Vehicle", LocalID); } else { RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step); - PhysicsScene.AfterStep += VehicleController.PostStep; + RegisterPostStepAction("BSPrim.Vehicle", LocalID, VehicleController.PostStep); } }); } @@ -732,7 +767,7 @@ public class BSPrim : BSPhysObject set { PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity"); - _velocity = value; + _velocity = Util.ClampV(value, BSParam.MaxLinearVelocity); if (PhysBody.HasPhysicalBody) { DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, _velocity); @@ -1098,7 +1133,7 @@ public class BSPrim : BSPhysObject return _rotationalVelocity; } set { - _rotationalVelocity = value; + _rotationalVelocity = Util.ClampV(value, BSParam.MaxAngularVelocity); if (PhysBody.HasPhysicalBody) { DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); @@ -1230,6 +1265,7 @@ public class BSPrim : BSPhysObject RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) { + // Don't do hovering while the object is selected. if (!IsPhysicallyActive) return; @@ -1737,10 +1773,9 @@ public class BSPrim : BSPhysObject // Assign directly to the local variables so the normal set actions do not happen _position = entprop.Position; _orientation = entprop.Rotation; - // _velocity = entprop.Velocity; // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be // very sensitive to velocity changes. - if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, 0.1f)) + if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, BSParam.UpdateVelocityChangeThreshold)) _velocity = entprop.Velocity; _acceleration = entprop.Acceleration; _rotationalVelocity = entprop.RotationalVelocity; From 326634a0b38fc21fd52a7bfb0c89a0d4c13f0dae Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 1 Mar 2013 09:43:40 -0800 Subject: [PATCH 5/8] BulletSim: more things into the TODO list. --- OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index 4dc16f4fce..8a15abe39f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt @@ -9,6 +9,9 @@ Enable vehicle border crossings (at least as poorly as ODE) Lock axis Deleting a linkset while standing on the root will leave the physical shape of the root behind. Not sure if it is because standing on it. Done with large prim linksets. +Linkset child rotations. + Nebadon spiral tube has middle sections which are rotated wrong. + Select linked spiral tube. Delink and note where the middle section ends up. Vehicle angular vertical attraction vehicle angular banking Center-of-gravity @@ -68,6 +71,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation GENERAL TODO LIST: ================================================= +Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects. + Regular triangle meshes don't do physical collisions. Resitution of a prim works on another prim but not on terrain. The dropped prim doesn't bounce properly on the terrain. Add a sanity check for PIDTarget location. @@ -338,4 +343,4 @@ Avatar standing on a moving object should start to move with the object. (DONE 2 Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE. Verify that angular motion specified around Z moves in the vehicle coordinates. DONE 20130120: BulletSim properly applies force in vehicle relative coordinates. -Nebadon vehicles turning funny in arena (DONE) \ No newline at end of file +Nebadon vehicles turning funny in arena (DONE) From c851ebcd8c65d1cf371379bf75d98f544b54ac7a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 1 Mar 2013 21:47:17 +0000 Subject: [PATCH 6/8] Add the Mono AddinDependency attribute to the example region modules. It turns out this is required to get Mono.Addins to pick up plugin DLLs --- .../Example/BareBonesNonShared/BareBonesNonSharedModule.cs | 3 ++- .../Example/BareBonesShared/BareBonesSharedModule.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs index ad2fc7a9b3..0615036841 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs @@ -33,10 +33,11 @@ using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -// You will need to uncomment this line if you are adding a region module to some other assembly which does not already +// You will need to uncomment these lines if you are adding a region module to some other assembly which does not already // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans // the available DLLs //[assembly: Addin("MyModule", "1.0")] +//[assembly: AddinDependency("OpenSim", "0.5")] namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared { diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs index bb9cbb7325..811a2636c0 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs @@ -33,10 +33,11 @@ using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -// You will need to uncomment this line if you are adding a region module to some other assembly which does not already +// You will need to uncomment these lines if you are adding a region module to some other assembly which does not already // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans // the available DLLs //[assembly: Addin("MyModule", "1.0")] +//[assembly: AddinDependency("OpenSim", "0.5")] namespace OpenSim.Region.OptionalModules.Example.BareBonesShared { From efa722786509bd8e02e23f11da974b4282dbd185 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 1 Mar 2013 14:18:01 -0800 Subject: [PATCH 7/8] Removed more vars from [Startup]. I think these were already moved elsewhere, because I can't find any reference to them in the code. --- bin/OpenSim.ini.example | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index f89606f1c6..ef35b170fb 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -300,26 +300,6 @@ ;; default is false ; TelehubAllowLandmark = false - ;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {} - ;; Bar (|) separated list of viewers which may gain access to the regions. - ;; One can use a substring of the viewer name to enable only certain - ;; versions - ;; Example: Agent uses the viewer "Imprudence 1.3.2.0" - ;; - "Imprudence" has access - ;; - "Imprudence 1.3" has access - ;; - "Imprudence 1.3.1" has no access - ; AllowedViewerList = - - ;# {BannedClients} {} {Bar (|) separated list of banned clients} {} - ;# Bar (|) separated list of viewers which may not gain access to the regions. - ;; One can use a Substring of the viewer name to disable only certain - ;; versions - ;; Example: Agent uses the viewer "Imprudence 1.3.2.0" - ;; - "Imprudence" has no access - ;; - "Imprudence 1.3" has no access - ;; - "Imprudence 1.3.1" has access - ; BannedViewerList = - [Map] ;# {GenerateMaptiles} {} {Generate map tiles?} {true false} true ;; Map tile options. From 20530ee66723faa78ab8cf93c096fa4626c3c701 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 1 Mar 2013 15:24:22 -0800 Subject: [PATCH 8/8] Moved permissions config vars out of [Startup] into [Permissions]. Backwards compatible ([Startup] still being looked up), but please update your configs sometime soon. --- .../World/Permissions/PermissionsModule.cs | 52 ++++++---- .../PrimLimitsModule/PrimLimitsModule.cs | 5 +- bin/OpenSim.ini.example | 88 ++++++++--------- bin/OpenSimDefaults.ini | 97 ++++++++++--------- 4 files changed, 128 insertions(+), 114 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index ddaa227c79..121fb2aaae 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -156,9 +156,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions public void Initialise(IConfigSource config) { - IConfig myConfig = config.Configs["Startup"]; - - string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); + string permissionModules = Util.GetConfigVarFromSections(config, "permissionmodules", + new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); List modules = new List(permissionModules.Split(',')); @@ -167,26 +166,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_Enabled = true; - m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false); - m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); - m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); - m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); - m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); - m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); + m_allowGridGods = Util.GetConfigVarFromSections(config, "allow_grid_gods", + new string[] { "Startup", "Permissions" }, false); + m_bypassPermissions = !Util.GetConfigVarFromSections(config, "serverside_object_permissions", + new string[] { "Startup", "Permissions" }, true); + m_propagatePermissions = Util.GetConfigVarFromSections(config, "propagate_permissions", + new string[] { "Startup", "Permissions" }, true); + m_RegionOwnerIsGod = Util.GetConfigVarFromSections(config, "region_owner_is_god", + new string[] { "Startup", "Permissions" }, true); + m_RegionManagerIsGod = Util.GetConfigVarFromSections(config, "region_manager_is_god", + new string[] { "Startup", "Permissions" }, false); + m_ParcelOwnerIsGod = Util.GetConfigVarFromSections(config, "parcel_owner_is_god", + new string[] { "Startup", "Permissions" }, true); - m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); + m_SimpleBuildPermissions = Util.GetConfigVarFromSections(config, "simple_build_permissions", + new string[] { "Startup", "Permissions" }, false); m_allowedScriptCreators - = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); + = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); m_allowedScriptEditors - = ParseUserSetConfigSetting(myConfig, "allowed_script_editors", m_allowedScriptEditors); + = ParseUserSetConfigSetting(config, "allowed_script_editors", m_allowedScriptEditors); if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); else m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); - string grant = myConfig.GetString("GrantLSL", ""); + string grant = Util.GetConfigVarFromSections(config, "GrantLSL", + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -196,7 +203,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions } } - grant = myConfig.GetString("GrantCS", ""); + grant = Util.GetConfigVarFromSections(config, "GrantCS", + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -206,7 +214,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions } } - grant = myConfig.GetString("GrantVB", ""); + grant = Util.GetConfigVarFromSections(config, "GrantVB", + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -216,7 +225,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions } } - grant = myConfig.GetString("GrantJS", ""); + grant = Util.GetConfigVarFromSections(config, "GrantJS", + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -226,7 +236,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions } } - grant = myConfig.GetString("GrantYP", ""); + grant = Util.GetConfigVarFromSections(config, "GrantYP", + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -464,11 +475,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions /// /// The default value for this attribute /// The parsed value - private static UserSet ParseUserSetConfigSetting(IConfig config, string settingName, UserSet defaultValue) + private static UserSet ParseUserSetConfigSetting(IConfigSource config, string settingName, UserSet defaultValue) { UserSet userSet = defaultValue; - - string rawSetting = config.GetString(settingName, defaultValue.ToString()); + + string rawSetting = Util.GetConfigVarFromSections(config, settingName, + new string[] {"Startup", "Permissions"}, defaultValue.ToString()); // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term // this should disappear. diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index c1957e2cb8..a6d43f1cff 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -57,9 +57,10 @@ namespace OpenSim.Region.OptionalModules public void Initialise(IConfigSource config) { - IConfig myConfig = config.Configs["Startup"]; + //IConfig myConfig = config.Configs["Startup"]; - string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); + string permissionModules = Util.GetConfigVarFromSections(config, "permissionmodules", + new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); List modules=new List(permissionModules.Split(',')); diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index ef35b170fb..0eb43a2ca3 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -220,50 +220,6 @@ ; physics = basicphysics ; physics = POS - ;# {permissionmodules} {} {Permission modules to use (may specify multiple modules, separated by comma} {} DefaultPermissionsModule - ;; Permission modules to use, separated by comma. - ;; Possible modules are DefaultPermissionsModule, PrimLimitsModule - ; permissionmodules = DefaultPermissionsModule - - ;# {serverside_object_permissions} {permissionmodules:DefaultPermissionsModule} {Activate permission handling by the sim?} {true false} true - ;; These are the parameters for the default permissions module - ;; - ;; If set to false, then, in theory, the server never carries out - ;; permission checks (allowing anybody to copy - ;; any item, etc. This may not yet be implemented uniformally. - ;; If set to true, then all permissions checks are carried out - ; serverside_object_permissions = true - - ;# {allow_grid_gods} {} {Allow grid gods?} {true false} false - ;; This allows users with a UserLevel of 200 or more to assume god - ;; powers in the regions in this simulator. - ; allow_grid_gods = false - - ;; This allows some control over permissions - ;; please note that this still doesn't duplicate SL, and is not intended to - ;# {region_owner_is_god} {} {Allow region owner gods} {true false} true - ;; Allow region owners to assume god powers in their regions - ; region_owner_is_god = true - - ;# {region_manager_is_god} {} {Allow region manager gods} {true false} false - ;; Allow region managers to assume god powers in regions they manage - ; region_manager_is_god = false - - ;# {parcel_owner_is_god} {} {Allow parcel owner gods} {true false} true - ;; Allow parcel owners to assume god powers in their parcels - ; parcel_owner_is_god = true - - ;# {simple_build_permissions} {} {Allow building in parcel by access list (no groups)} {true false} false - ;; More control over permissions - ;; This is definitely not SL! - ;; Provides a simple control for land owners to give build rights to - ;; specific avatars in publicly accessible parcels that disallow object - ;; creation in general. - ;; Owners specific avatars by adding them to the Access List of the parcel - ;; without having to use the Groups feature - ; simple_build_permissions = false - - ;# {DefaultScriptEngine} {} {Default script engine} {XEngine} XEngine ;; Default script engine to use. Currently, we only have XEngine ; DefaultScriptEngine = "XEngine" @@ -334,6 +290,50 @@ ;; got a large number of objects, so you can turn it off here if you'd like. ; DrawPrimOnMapTile = true +[Permissions] + ;# {permissionmodules} {} {Permission modules to use (may specify multiple modules, separated by comma} {} DefaultPermissionsModule + ;; Permission modules to use, separated by comma. + ;; Possible modules are DefaultPermissionsModule, PrimLimitsModule + ; permissionmodules = DefaultPermissionsModule + + ;# {serverside_object_permissions} {permissionmodules:DefaultPermissionsModule} {Activate permission handling by the sim?} {true false} true + ;; These are the parameters for the default permissions module + ;; + ;; If set to false, then, in theory, the server never carries out + ;; permission checks (allowing anybody to copy + ;; any item, etc. This may not yet be implemented uniformally. + ;; If set to true, then all permissions checks are carried out + ; serverside_object_permissions = true + + ;# {allow_grid_gods} {} {Allow grid gods?} {true false} false + ;; This allows users with a UserLevel of 200 or more to assume god + ;; powers in the regions in this simulator. + ; allow_grid_gods = false + + ;; This allows some control over permissions + ;; please note that this still doesn't duplicate SL, and is not intended to + ;# {region_owner_is_god} {} {Allow region owner gods} {true false} true + ;; Allow region owners to assume god powers in their regions + ; region_owner_is_god = true + + ;# {region_manager_is_god} {} {Allow region manager gods} {true false} false + ;; Allow region managers to assume god powers in regions they manage + ; region_manager_is_god = false + + ;# {parcel_owner_is_god} {} {Allow parcel owner gods} {true false} true + ;; Allow parcel owners to assume god powers in their parcels + ; parcel_owner_is_god = true + + ;# {simple_build_permissions} {} {Allow building in parcel by access list (no groups)} {true false} false + ;; More control over permissions + ;; This is definitely not SL! + ;; Provides a simple control for land owners to give build rights to + ;; specific avatars in publicly accessible parcels that disallow object + ;; creation in general. + ;; Owners specific avatars by adding them to the Access List of the parcel + ;; without having to use the Groups feature + ; simple_build_permissions = false + [Estates] ; If these values are commented out then the user will be asked for estate details when required (this is the normal case). diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 6ecb5dfc87..091107f975 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -230,54 +230,6 @@ ;physics = modified_BulletX ;physics = BulletSim - ; ## - ; ## PERMISSIONS - ; ## - - ;permissionmodules = "DefaultPermissionsModule" - - ; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy - ; any item, etc. This may not yet be implemented uniformally. - ; If set to true, then all permissions checks are carried out - ; Default is true - serverside_object_permissions = true - - allow_grid_gods = false - - ; This allows somne control over permissions - ; please note that this still doesn't duplicate SL, and is not intended to - ;region_owner_is_god = true - ;region_manager_is_god = false - ;parcel_owner_is_god = true - - ; Control user types that are allowed to create new scripts - ; Only enforced if serviceside_object_permissions is true - ; - ; Current possible values are - ; all - anyone can create scripts (subject to normal permissions) - ; gods - only administrators can create scripts (as long as allow_grid_gods is true) - ; Default value is all - ; allowed_script_creators = all - - ; Control user types that are allowed to edit (save) scripts - ; Only enforced if serviceside_object_permissions is true - ; - ; Current possible values are - ; all - anyone can edit scripts (subject to normal permissions) - ; gods - only administrators can edit scripts (as long as allow_grid_gods is true) - ; Default value is all - ; allowed_script_editors = all - - ; Provides a simple control for land owners to give build rights to specific avatars - ; in publicly accessible parcels that disallow object creation in general. - ; Owners specific avatars by adding them to the Access List of the parcel - ; without having to use the Groups feature - ; Disabled by default - ; simple_build_permissions = False - - ; Minimum user level required to upload assets - ;LevelUpload = 0 - ; ## ; ## SCRIPT ENGINE ; ## @@ -344,6 +296,55 @@ ; Use terrain texture for maptiles if true, use shaded green if false TextureOnMapTile = true +[Permissions] + ; ## + ; ## PERMISSIONS + ; ## + + ;permissionmodules = "DefaultPermissionsModule" + + ; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy + ; any item, etc. This may not yet be implemented uniformally. + ; If set to true, then all permissions checks are carried out + ; Default is true + serverside_object_permissions = true + + allow_grid_gods = false + + ; This allows somne control over permissions + ; please note that this still doesn't duplicate SL, and is not intended to + ;region_owner_is_god = true + ;region_manager_is_god = false + ;parcel_owner_is_god = true + + ; Control user types that are allowed to create new scripts + ; Only enforced if serviceside_object_permissions is true + ; + ; Current possible values are + ; all - anyone can create scripts (subject to normal permissions) + ; gods - only administrators can create scripts (as long as allow_grid_gods is true) + ; Default value is all + ; allowed_script_creators = all + + ; Control user types that are allowed to edit (save) scripts + ; Only enforced if serviceside_object_permissions is true + ; + ; Current possible values are + ; all - anyone can edit scripts (subject to normal permissions) + ; gods - only administrators can edit scripts (as long as allow_grid_gods is true) + ; Default value is all + ; allowed_script_editors = all + + ; Provides a simple control for land owners to give build rights to specific avatars + ; in publicly accessible parcels that disallow object creation in general. + ; Owners specific avatars by adding them to the Access List of the parcel + ; without having to use the Groups feature + ; Disabled by default + ; simple_build_permissions = False + + ; Minimum user level required to upload assets + ;LevelUpload = 0 + [RegionReady] ; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled