From e712678689f37f7a58e02547a5dbe6a214680db2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 14 Jul 2008 01:27:47 +0000 Subject: Patch #9147 Patch #4 of the region settings series. Partial functionality of the new storage system. More patches to follow. --- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- .../Communications/Local/LocalBackEndServices.cs | 2 +- OpenSim/Region/DataSnapshot/SnapshotStore.cs | 4 +- .../Region/Environment/Interfaces/IEstateModule.cs | 38 ++++++ .../Modules/World/Estate/EstateManagementModule.cs | 132 +++++++++++---------- .../Environment/Modules/World/Land/LandObject.cs | 14 ++- .../Modules/World/Terrain/TerrainModule.cs | 4 +- OpenSim/Region/Environment/Scenes/Scene.cs | 25 +--- .../Scenes/SceneObjectGroup.Inventory.cs | 2 +- .../Scenes/SceneObjectPart.Inventory.cs | 2 +- .../Region/Environment/Scenes/SimStatsReporter.cs | 11 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 17 +-- .../Shared/Api/Implementation/LSL_Api.cs | 17 +-- 13 files changed, 162 insertions(+), 108 deletions(-) create mode 100644 OpenSim/Region/Environment/Interfaces/IEstateModule.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 621d0ef..dadaf88 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -136,7 +136,7 @@ namespace OpenSim.Region.ClientStack scene.PhysicsScene = GetPhysicsScene(); scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); - scene.PhysicsScene.SetWaterLevel(regionInfo.EstateSettings.waterHeight); + scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight); //Master Avatar Setup UserProfileData masterAvatar; diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 47606c2..782465e 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -207,7 +207,7 @@ namespace OpenSim.Region.Communications.Local map.Name = regInfo.RegionName; map.X = (ushort) regInfo.RegionLocX; map.Y = (ushort) regInfo.RegionLocY; - map.WaterHeight = (byte) regInfo.EstateSettings.waterHeight; + map.WaterHeight = (byte) regInfo.RegionSettings.WaterHeight; map.MapImageId = regInfo.EstateSettings.terrainImageID; map.Agents = 1; map.RegionFlags = 72458694; diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index 4f4beea..769b3ac 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs @@ -258,11 +258,11 @@ namespace OpenSim.Region.DataSnapshot // "PG" - Mormontown // "Mature" - Sodom and Gomorrah // (Depreciated) "Patriotic Nigra Testing Sandbox" - Abandon Hope All Ye Who Enter Here - if ((scene.RegionInfo.EstateSettings.simAccess & Simulator.SimAccess.Mature) == Simulator.SimAccess.Mature) + if (scene.RegionInfo.RegionSettings.Maturity == 1) { return "Mature"; } - else if ((scene.RegionInfo.EstateSettings.simAccess & Simulator.SimAccess.PG) == Simulator.SimAccess.PG) + else if (scene.RegionInfo.RegionSettings.Maturity == 0) { return "PG"; } diff --git a/OpenSim/Region/Environment/Interfaces/IEstateModule.cs b/OpenSim/Region/Environment/Interfaces/IEstateModule.cs new file mode 100644 index 0000000..070b804 --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/IEstateModule.cs @@ -0,0 +1,38 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using OpenSim.Framework; +using libsecondlife; + +namespace OpenSim.Region.Environment.Interfaces +{ + public interface IEstateModule : IRegionModule + { + uint GetRegionFlags(); + } +} diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 9ef3e10..15141e5 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -37,7 +37,7 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.Environment.Modules.World.Estate { - public class EstateManagementModule : IRegionModule + public class EstateManagementModule : IEstateModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -57,50 +57,46 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges) { - m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None; - if (blockTerraform) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.BlockTerraform; - } + m_scene.RegionInfo.RegionSettings.BlockTerraform = true; + else + m_scene.RegionInfo.RegionSettings.BlockTerraform = false; if (noFly) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.NoFly; - } + m_scene.RegionInfo.RegionSettings.BlockFly = true; + else + m_scene.RegionInfo.RegionSettings.BlockFly = false; if (allowDamage) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.AllowDamage; - } + m_scene.RegionInfo.RegionSettings.AllowDamage = true; + else + m_scene.RegionInfo.RegionSettings.AllowDamage = false; if (blockLandResell) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.BlockLandResell; - } - - m_scene.RegionInfo.EstateSettings.maxAgents = (byte) maxAgents; + m_scene.RegionInfo.RegionSettings.AllowLandResell = false; + else + m_scene.RegionInfo.RegionSettings.AllowLandResell = true; - m_scene.RegionInfo.EstateSettings.objectBonusFactor = objectBonusFactor; + m_scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; - m_scene.RegionInfo.EstateSettings.simAccess = (Simulator.SimAccess) matureLevel; + m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; + if(matureLevel <= 13) + m_scene.RegionInfo.RegionSettings.Maturity = 0; + else + m_scene.RegionInfo.RegionSettings.Maturity = 1; if (restrictPushObject) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.RestrictPushObject; - } + m_scene.RegionInfo.RegionSettings.RestrictPushing = true; + else + m_scene.RegionInfo.RegionSettings.RestrictPushing = false; if (allowParcelChanges) - { - m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | - Simulator.RegionFlags.AllowParcelChanges; - } + m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true; + else + m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; + + m_scene.RegionInfo.RegionSettings.Save(); sendRegionInfoPacketToAll(); } @@ -175,19 +171,20 @@ namespace OpenSim.Region.Environment.Modules.World.Estate bool UseFixedSun, float SunHour) { // Water Height - m_scene.RegionInfo.EstateSettings.waterHeight = WaterHeight; + m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; // Terraforming limits - m_scene.RegionInfo.EstateSettings.terrainRaiseLimit = TerrainRaiseLimit; - m_scene.RegionInfo.EstateSettings.terrainLowerLimit = TerrainLowerLimit; + m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit; + m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; // Time of day / fixed sun - m_scene.RegionInfo.EstateSettings.useFixedSun = UseFixedSun; + m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; m_scene.RegionInfo.EstateSettings.sunHour = SunHour; m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour); //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); sendRegionInfoPacketToAll(); + m_scene.RegionInfo.RegionSettings.Save(); } private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) @@ -339,23 +336,22 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics) { if (physics) - { - m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics; - } + m_scene.RegionInfo.RegionSettings.DisablePhysics = true; else - { - m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipPhysics; - } + m_scene.RegionInfo.RegionSettings.DisablePhysics = false; if (scripted) - { - m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipScripts; - } + m_scene.RegionInfo.RegionSettings.DisableScripts = true; else - { - m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipScripts; - } + m_scene.RegionInfo.RegionSettings.DisableScripts = false; + + if (collisionEvents) + m_scene.RegionInfo.RegionSettings.DisableCollisions = true; + else + m_scene.RegionInfo.RegionSettings.DisableCollisions = false; + + m_scene.RegionInfo.RegionSettings.Save(); m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); } @@ -378,24 +374,27 @@ namespace OpenSim.Region.Environment.Modules.World.Estate RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; args.estateID = m_scene.RegionInfo.EstateSettings.estateID; - args.maxAgents = m_scene.RegionInfo.EstateSettings.maxAgents; - args.objectBonusFactor = m_scene.RegionInfo.EstateSettings.objectBonusFactor; + args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit; + args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus; args.parentEstateID = m_scene.RegionInfo.EstateSettings.parentEstateID; args.pricePerMeter = m_scene.RegionInfo.EstateSettings.pricePerMeter; args.redirectGridX = m_scene.RegionInfo.EstateSettings.redirectGridX; args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY; - args.regionFlags = (uint)(m_scene.RegionInfo.EstateSettings.regionFlags); - args.simAccess = (byte)m_scene.RegionInfo.EstateSettings.simAccess; + args.regionFlags = GetRegionFlags(); + byte mature = 13; + if(m_scene.RegionInfo.RegionSettings.Maturity == 1) + mature = 21; + args.simAccess = mature; - if (m_scene.RegionInfo.EstateSettings.useFixedSun) + if (m_scene.RegionInfo.RegionSettings.FixedSun) args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour; else args.sunHour = m_scene.EventManager.GetSunLindenHour(); - args.terrainLowerLimit = m_scene.RegionInfo.EstateSettings.terrainLowerLimit; - args.terrainRaiseLimit = m_scene.RegionInfo.EstateSettings.terrainRaiseLimit; - args.useEstateSun = !m_scene.RegionInfo.EstateSettings.useFixedSun; - args.waterHeight = m_scene.RegionInfo.EstateSettings.waterHeight; + args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; + args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; + args.useEstateSun = !m_scene.RegionInfo.RegionSettings.FixedSun; + args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.simName = m_scene.RegionInfo.RegionName; @@ -541,10 +540,13 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.terrainStartHeight1 = m_scene.RegionInfo.EstateSettings.terrainStartHeight1; args.terrainStartHeight2 = m_scene.RegionInfo.EstateSettings.terrainStartHeight2; args.terrainStartHeight3 = m_scene.RegionInfo.EstateSettings.terrainStartHeight3; - args.simAccess = (byte)m_scene.RegionInfo.EstateSettings.simAccess; - args.waterHeight = m_scene.RegionInfo.EstateSettings.waterHeight; + byte mature = 13; + if(m_scene.RegionInfo.RegionSettings.Maturity == 1) + mature = 21; + args.simAccess = mature; + args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; - args.regionFlags = (uint)m_scene.RegionInfo.EstateSettings.regionFlags; + args.regionFlags = GetRegionFlags(); args.regionName = m_scene.RegionInfo.RegionName; args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; args.terrainBase0 = m_scene.RegionInfo.EstateSettings.terrainBase0; @@ -573,6 +575,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; + m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += EventManager_OnNewClient; m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; } @@ -602,8 +605,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate public void changeWaterHeight(float height) { - setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit, - m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour); + setRegionTerrainSettings(height, (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit, + m_scene.RegionInfo.RegionSettings.FixedSun, m_scene.RegionInfo.EstateSettings.sunHour); sendRegionInfoPacketToAll(); } @@ -631,5 +634,12 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnLandStatRequest += HandleLandStatRequest; sendRegionHandshake(client); } + + public uint GetRegionFlags() + { + Simulator.RegionFlags flags = Simulator.RegionFlags.None; + //m_scene.RegionInfo.RegionSettings. + return (uint)flags; + } } } diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 2b24435..4a5948f 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land //Normal Calculations return Convert.ToInt32( Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * - Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor))); ; + Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ; } } public int getSimulatorMaxPrimCount(ILandObject thisObject) @@ -161,7 +161,15 @@ namespace OpenSim.Region.Environment.Modules.World.Land 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, getParcelMaxPrimCount(this), getSimulatorMaxPrimCount(this), (uint)m_scene.RegionInfo.EstateSettings.regionFlags); + IEstateModule estateModule = m_scene.RequestModuleInterface(); + uint regionFlags = 67108864; + if(estateModule != null) + regionFlags = estateModule.GetRegionFlags(); + remote_client.SendLandProperties(remote_client, sequence_id, + snap_selection, request_result, landData, + (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, + getParcelMaxPrimCount(this), + getSimulatorMaxPrimCount(this), regionFlags); } public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) @@ -855,4 +863,4 @@ namespace OpenSim.Region.Environment.Modules.World.Land #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index f47e6c0..9892794 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs @@ -541,8 +541,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain private bool LimitChannelChanges(int xStart, int yStart) { bool changesLimited = false; - double minDelta = m_scene.RegionInfo.EstateSettings.terrainLowerLimit; - double maxDelta = m_scene.RegionInfo.EstateSettings.terrainRaiseLimit; + double minDelta = m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; + double maxDelta = m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; // loop through the height map for this patch and compare it against // the revert map diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a78ad98..36a0ffc 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -297,24 +297,11 @@ namespace OpenSim.Region.Environment.Scenes m_httpListener = httpServer; m_dumpAssetsToFile = dumpAssetsToFile; - if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts) - { - m_scripts_enabled = false; - } - else - { - m_scripts_enabled = true; - } - if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipPhysics) == Simulator.RegionFlags.SkipPhysics) - { - m_physics_enabled = false; - } - else - { - m_physics_enabled = true; - } + m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts; + + m_physics_enabled = !RegionInfo.RegionSettings.DisablePhysics; - m_statsReporter = new SimStatsReporter(regInfo); + m_statsReporter = new SimStatsReporter(this); m_statsReporter.OnSendStatsResult += SendSimStatsPackets; m_statsReporter.SetObjectCapacity(objectCapacity); @@ -1076,7 +1063,7 @@ namespace OpenSim.Region.Environment.Scenes //float tmpval = (float)hm[x, y]; float heightvalue = (float)hm[x, y]; - if ((float)heightvalue > m_regInfo.EstateSettings.waterHeight) + if (heightvalue > (float)m_regInfo.RegionSettings.WaterHeight) { // scale height value heightvalue = low + mid * (heightvalue - low) / mid; @@ -1110,7 +1097,7 @@ namespace OpenSim.Region.Environment.Scenes else { // Y flip the cordinates - heightvalue = m_regInfo.EstateSettings.waterHeight - heightvalue; + heightvalue = (float)m_regInfo.RegionSettings.WaterHeight - heightvalue; if (heightvalue > 19) heightvalue = 19; if (heightvalue < 0) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index 8feb852..0696432 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Scenes public void CreateScriptInstances(int startParam, bool postOnRez) { // Don't start scripts if they're turned off in the region! - if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) + if (!m_scene.RegionInfo.RegionSettings.DisableScripts) { foreach (SceneObjectPart part in m_parts.Values) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index d407392..841b7b6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Scenes AddFlag(LLObject.ObjectFlags.Scripted); - if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) + if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) { AssetCache cache = m_parentGroup.Scene.AssetCache; diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 90a971f..609b4ed 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -29,6 +29,7 @@ using System; using System.Timers; using libsecondlife.Packets; using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; namespace OpenSim.Region.Environment.Scenes { @@ -104,16 +105,19 @@ namespace OpenSim.Region.Environment.Scenes SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); + private Scene m_scene; + private RegionInfo ReportingRegion; private Timer m_report = new Timer(); - public SimStatsReporter(RegionInfo regionData) + public SimStatsReporter(Scene scene) { statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000); - ReportingRegion = regionData; + m_scene = scene; + ReportingRegion = scene.RegionInfo; for (int i = 0; i<21;i++) { sb[i] = new SimStatsPacket.StatBlock(); @@ -145,7 +149,8 @@ namespace OpenSim.Region.Environment.Scenes statpack.Region.RegionY = ReportingRegion.RegionLocY; try { - statpack.Region.RegionFlags = (uint) ReportingRegion.EstateSettings.regionFlags; + IEstateModule estateModule = m_scene.RequestModuleInterface(); + statpack.Region.RegionFlags = estateModule.GetRegionFlags(); } catch (Exception) { diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 4fc4608..0d3049d 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2822,7 +2822,7 @@ namespace OpenSim.Region.ScriptEngine.Common public double llWater(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - return World.RegionInfo.EstateSettings.waterHeight; + return World.RegionInfo.RegionSettings.WaterHeight; } public void llPassTouches(int pass) @@ -6456,10 +6456,10 @@ namespace OpenSim.Region.ScriptEngine.Common case 7: // DATA_SIM_RATING if (info == null) return LLUUID.Zero.ToString(); - int access = (int)info.EstateSettings.simAccess; - if (access == 21) - reply = "MATURE"; - else if (access == 13) + int access = info.RegionSettings.Maturity; + if (access == 0) + reply = "PG"; + else if (access == 1) reply = "MATURE"; else reply = "UNKNOWN"; @@ -6829,7 +6829,10 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetRegionFlags() { m_host.AddScriptLPS(1); - return (int)World.RegionInfo.EstateSettings.regionFlags; + IEstateModule estate = World.RequestModuleInterface(); + if(estate == null) + return 67108864; + return estate.GetRegionFlags(); } public string llXorBase64StringsCorrect(string str1, string str2) @@ -7006,7 +7009,7 @@ namespace OpenSim.Region.ScriptEngine.Common // Which probably will be irrelevent in OpenSim.... LandData land = World.GetLandData((float)pos.x, (float)pos.y); - float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; + float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; if (land == null) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8edd169..30a64c7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2686,7 +2686,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double llWater(LSL_Types.Vector3 offset) { m_host.AddScriptLPS(1); - return World.RegionInfo.EstateSettings.waterHeight; + return World.RegionInfo.RegionSettings.WaterHeight; } public void llPassTouches(int pass) @@ -6235,10 +6235,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case 7: // DATA_SIM_RATING if (info == null) return LLUUID.Zero.ToString(); - int access = (int)info.EstateSettings.simAccess; - if (access == 21) - reply = "MATURE"; - else if (access == 13) + int access = info.RegionSettings.Maturity; + if (access == 0) + reply = "PG"; + else if (access == 1) reply = "MATURE"; else reply = "UNKNOWN"; @@ -6609,7 +6609,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetRegionFlags() { m_host.AddScriptLPS(1); - return (int)World.RegionInfo.EstateSettings.regionFlags; + IEstateModule estate = World.RequestModuleInterface(); + if(estate == null) + return 67108864; + return (int)estate.GetRegionFlags(); } public string llXorBase64StringsCorrect(string str1, string str2) @@ -6786,7 +6789,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Which probably will be irrelevent in OpenSim.... LandData land = World.GetLandData((float)pos.x, (float)pos.y); - float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; + float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; if (land == null) { -- cgit v1.1