aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-14 01:27:47 +0000
committerMelanie Thielker2008-07-14 01:27:47 +0000
commite712678689f37f7a58e02547a5dbe6a214680db2 (patch)
treea7f13c72ca14860cfb2099fe0603878e57120d7d /OpenSim
parentMantis#1728. Thank you kindly, Mikem for a patch that solves: (diff)
downloadopensim-SC-e712678689f37f7a58e02547a5dbe6a214680db2.zip
opensim-SC-e712678689f37f7a58e02547a5dbe6a214680db2.tar.gz
opensim-SC-e712678689f37f7a58e02547a5dbe6a214680db2.tar.bz2
opensim-SC-e712678689f37f7a58e02547a5dbe6a214680db2.tar.xz
Patch #9147
Patch #4 of the region settings series. Partial functionality of the new storage system. More patches to follow.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/EstateSettings.cs162
-rw-r--r--OpenSim/Framework/RegionSettings.cs2
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs2
-rw-r--r--OpenSim/Region/DataSnapshot/SnapshotStore.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IEstateModule.cs38
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs132
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs25
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs17
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
15 files changed, 163 insertions, 271 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index aa8688b..35ade66 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -53,17 +53,11 @@ namespace OpenSim.Framework
53 private LLUUID m_estateManager8; 53 private LLUUID m_estateManager8;
54 private LLUUID m_estateManager9; 54 private LLUUID m_estateManager9;
55 private string m_estateName; 55 private string m_estateName;
56 private byte m_maxAgents;
57 private float m_objectBonusFactor;
58 56
59 private uint m_parentEstateID; 57 private uint m_parentEstateID;
60 private int m_pricePerMeter; 58 private int m_pricePerMeter;
61 private int m_redirectGridX; 59 private int m_redirectGridX;
62 private int m_redirectGridY; 60 private int m_redirectGridY;
63 private bool m_regionAllowTerraform;
64 private Simulator.RegionFlags m_regionFlags;
65 private float m_regionWaterHeight;
66 private Simulator.SimAccess m_simAccess;
67 private float m_sunHour; 61 private float m_sunHour;
68 private LLVector3 m_sunPosition; 62 private LLVector3 m_sunPosition;
69 private LLUUID m_terrainBase0; 63 private LLUUID m_terrainBase0;
@@ -80,15 +74,11 @@ namespace OpenSim.Framework
80 private float m_terrainHeightRange2; 74 private float m_terrainHeightRange2;
81 private float m_terrainHeightRange3; 75 private float m_terrainHeightRange3;
82 private LLUUID m_terrainImageID; 76 private LLUUID m_terrainImageID;
83 private float m_terrainLowerLimit;
84 private double m_terrainMultiplier; 77 private double m_terrainMultiplier;
85 private float m_terrainRaiseLimit;
86 private float m_terrainStartHeight0; 78 private float m_terrainStartHeight0;
87 private float m_terrainStartHeight1; 79 private float m_terrainStartHeight1;
88 private float m_terrainStartHeight2; 80 private float m_terrainStartHeight2;
89 private float m_terrainStartHeight3; 81 private float m_terrainStartHeight3;
90 private bool m_useFixedSun;
91 private float m_waterHeight;
92 82
93 public EstateSettings() 83 public EstateSettings()
94 { 84 {
@@ -132,26 +122,6 @@ namespace OpenSim.Framework
132 } 122 }
133 } 123 }
134 124
135 public byte maxAgents
136 {
137 get { return m_maxAgents; }
138 set
139 {
140 m_maxAgents = value;
141 configMember.forceSetConfigurationOption("max_agents", m_maxAgents.ToString());
142 }
143 }
144
145 public float objectBonusFactor
146 {
147 get { return m_objectBonusFactor; }
148 set
149 {
150 m_objectBonusFactor = value;
151 configMember.forceSetConfigurationOption("object_bonus_factor", m_objectBonusFactor.ToString());
152 }
153 }
154
155 public int redirectGridX 125 public int redirectGridX
156 { 126 {
157 get { return m_redirectGridX; } 127 get { return m_redirectGridX; }
@@ -172,36 +142,12 @@ namespace OpenSim.Framework
172 } 142 }
173 } 143 }
174 144
175 public Simulator.RegionFlags regionFlags
176 {
177 get { return m_regionFlags; }
178 set
179 {
180 //m_regionFlags = (Simulator.RegionFlags)0x400000;
181 m_regionFlags = value;
182 configMember.forceSetConfigurationOption("region_flags", ((uint) m_regionFlags).ToString());
183 }
184 }
185
186 public Simulator.SimAccess simAccess
187 {
188 get { return m_simAccess; }
189 set
190 {
191 m_simAccess = value;
192 configMember.forceSetConfigurationOption("sim_access", ((byte) m_simAccess).ToString());
193 }
194 }
195
196 public float sunHour 145 public float sunHour
197 { 146 {
198 get { return m_sunHour; } 147 get { return m_sunHour; }
199 set 148 set
200 { 149 {
201 m_sunHour = value; 150 m_sunHour = value;
202
203 if (useFixedSun)
204 configMember.forceSetConfigurationOption("sun_hour", m_sunHour.ToString());
205 } 151 }
206 } 152 }
207 153
@@ -215,36 +161,6 @@ namespace OpenSim.Framework
215 } 161 }
216 } 162 }
217 163
218 public float terrainRaiseLimit
219 {
220 get { return m_terrainRaiseLimit; }
221 set
222 {
223 m_terrainRaiseLimit = value;
224 configMember.forceSetConfigurationOption("terrain_raise_limit", m_terrainRaiseLimit.ToString());
225 }
226 }
227
228 public float terrainLowerLimit
229 {
230 get { return m_terrainLowerLimit; }
231 set
232 {
233 m_terrainLowerLimit = value;
234 configMember.forceSetConfigurationOption("terrain_lower_limit", m_terrainLowerLimit.ToString());
235 }
236 }
237
238 public bool useFixedSun
239 {
240 get { return m_useFixedSun; }
241 set
242 {
243 m_useFixedSun = value;
244 configMember.forceSetConfigurationOption("use_fixed_sun", m_useFixedSun.ToString());
245 }
246 }
247
248 public int pricePerMeter 164 public int pricePerMeter
249 { 165 {
250 get { return m_pricePerMeter; } 166 get { return m_pricePerMeter; }
@@ -256,28 +172,6 @@ namespace OpenSim.Framework
256 } 172 }
257 173
258 174
259 public float regionWaterHeight
260 {
261 get { return m_regionWaterHeight; }
262 set
263 {
264 m_regionWaterHeight = value;
265 configMember.forceSetConfigurationOption("region_water_height", m_regionWaterHeight.ToString());
266 }
267 }
268
269
270 public bool regionAllowTerraform
271 {
272 get { return m_regionAllowTerraform; }
273 set
274 {
275 m_regionAllowTerraform = value;
276 configMember.forceSetConfigurationOption("region_allow_terraform", m_regionAllowTerraform.ToString());
277 }
278 }
279
280
281 // Region Information 175 // Region Information
282 // Low resolution 'base' textures. No longer used. 176 // Low resolution 'base' textures. No longer used.
283 177
@@ -473,16 +367,6 @@ namespace OpenSim.Framework
473 } 367 }
474 } 368 }
475 369
476 public float waterHeight
477 {
478 get { return m_waterHeight; }
479 set
480 {
481 m_waterHeight = value;
482 configMember.forceSetConfigurationOption("water_height", m_waterHeight.ToString());
483 }
484 }
485
486 public LLUUID terrainImageID 370 public LLUUID terrainImageID
487 { 371 {
488 get { return m_terrainImageID; } 372 get { return m_terrainImageID; }
@@ -760,30 +644,16 @@ namespace OpenSim.Framework
760 configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40", 644 configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40",
761 true); 645 true);
762 646
763 configMember.addConfigurationOption("object_bonus_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
764 String.Empty, "1.0", true);
765 configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, 647 configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
766 "0", true); 648 "0", true);
767 configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, 649 configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
768 "0", true); 650 "0", true);
769 configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty,
770 "336723974", true); //Taken from a Linden sim for the moment.
771 configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "21",
772 true);
773 configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0", 651 configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0",
774 true); 652 true);
775 configMember.addConfigurationOption("terrain_raise_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
776 String.Empty, "4.0", true); //4 is the LL default
777 configMember.addConfigurationOption("terrain_lower_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
778 String.Empty, "-4.0", true); //-4.0 is the LL default
779 configMember.addConfigurationOption("use_fixed_sun", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty, 653 configMember.addConfigurationOption("use_fixed_sun", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty,
780 "false", true); 654 "false", true);
781 configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, 655 configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
782 String.Empty, "1", true); 656 String.Empty, "1", true);
783 configMember.addConfigurationOption("region_water_height",
784 ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "20", true);
785 configMember.addConfigurationOption("region_allow_terraform",
786 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty, "true", true);
787 657
788 configMember.addConfigurationOption("terrain_base_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty, 658 configMember.addConfigurationOption("terrain_base_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
789 "b8d3965a-ad78-bf43-699b-bff8eca6c975", true); 659 "b8d3965a-ad78-bf43-699b-bff8eca6c975", true);
@@ -868,46 +738,18 @@ namespace OpenSim.Framework
868 case "parent_estate_id": 738 case "parent_estate_id":
869 m_parentEstateID = (uint) configuration_result; 739 m_parentEstateID = (uint) configuration_result;
870 break; 740 break;
871 case "max_agents":
872 m_maxAgents = (byte) configuration_result;
873 break;
874
875 case "object_bonus_factor":
876 m_objectBonusFactor = (float) configuration_result;
877 break;
878 case "redirect_grid_x": 741 case "redirect_grid_x":
879 m_redirectGridX = (int) configuration_result; 742 m_redirectGridX = (int) configuration_result;
880 break; 743 break;
881 case "redirect_grid_y": 744 case "redirect_grid_y":
882 m_redirectGridY = (int) configuration_result; 745 m_redirectGridY = (int) configuration_result;
883 break; 746 break;
884 case "region_flags":
885 m_regionFlags = (Simulator.RegionFlags) ((uint) configuration_result);
886 break;
887 case "sim_access":
888 m_simAccess = (Simulator.SimAccess) ((byte) configuration_result);
889 break;
890 case "sun_hour": 747 case "sun_hour":
891 m_sunHour = (float) configuration_result; 748 m_sunHour = (float) configuration_result;
892 break; 749 break;
893 case "terrain_raise_limit":
894 m_terrainRaiseLimit = (float) configuration_result;
895 break;
896 case "terrain_lower_limit":
897 m_terrainLowerLimit = (float) configuration_result;
898 break;
899 case "use_fixed_sun":
900 m_useFixedSun = (bool) configuration_result;
901 break;
902 case "price_per_meter": 750 case "price_per_meter":
903 m_pricePerMeter = Convert.ToInt32(configuration_result); 751 m_pricePerMeter = Convert.ToInt32(configuration_result);
904 break; 752 break;
905 case "region_water_height":
906 m_regionWaterHeight = (float) configuration_result;
907 break;
908 case "region_allow_terraform":
909 m_regionAllowTerraform = (bool) configuration_result;
910 break;
911 753
912 case "terrain_base_0": 754 case "terrain_base_0":
913 m_terrainBase0 = (LLUUID) configuration_result; 755 m_terrainBase0 = (LLUUID) configuration_result;
@@ -970,10 +812,6 @@ namespace OpenSim.Framework
970 case "terrain_multiplier": 812 case "terrain_multiplier":
971 m_terrainMultiplier = Convert.ToDouble(configuration_result); 813 m_terrainMultiplier = Convert.ToDouble(configuration_result);
972 break; 814 break;
973 case "water_height":
974 double tmpVal = (double) configuration_result;
975 m_waterHeight = (float) tmpVal;
976 break;
977 case "terrain_image_id": 815 case "terrain_image_id":
978 m_terrainImageID = (LLUUID) configuration_result; 816 m_terrainImageID = (LLUUID) configuration_result;
979 break; 817 break;
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs
index 06cf7bf..f525da0 100644
--- a/OpenSim/Framework/RegionSettings.cs
+++ b/OpenSim/Framework/RegionSettings.cs
@@ -458,7 +458,7 @@ namespace OpenSim.Framework
458 set { m_TerrainRaiseLimit = value; } 458 set { m_TerrainRaiseLimit = value; }
459 } 459 }
460 460
461 private double m_TerrainLowerLimit = 100; 461 private double m_TerrainLowerLimit = -100;
462 462
463 public double TerrainLowerLimit 463 public double TerrainLowerLimit
464 { 464 {
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
136 136
137 scene.PhysicsScene = GetPhysicsScene(); 137 scene.PhysicsScene = GetPhysicsScene();
138 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); 138 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
139 scene.PhysicsScene.SetWaterLevel(regionInfo.EstateSettings.waterHeight); 139 scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight);
140 140
141 //Master Avatar Setup 141 //Master Avatar Setup
142 UserProfileData masterAvatar; 142 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
207 map.Name = regInfo.RegionName; 207 map.Name = regInfo.RegionName;
208 map.X = (ushort) regInfo.RegionLocX; 208 map.X = (ushort) regInfo.RegionLocX;
209 map.Y = (ushort) regInfo.RegionLocY; 209 map.Y = (ushort) regInfo.RegionLocY;
210 map.WaterHeight = (byte) regInfo.EstateSettings.waterHeight; 210 map.WaterHeight = (byte) regInfo.RegionSettings.WaterHeight;
211 map.MapImageId = regInfo.EstateSettings.terrainImageID; 211 map.MapImageId = regInfo.EstateSettings.terrainImageID;
212 map.Agents = 1; 212 map.Agents = 1;
213 map.RegionFlags = 72458694; 213 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
258 // "PG" - Mormontown 258 // "PG" - Mormontown
259 // "Mature" - Sodom and Gomorrah 259 // "Mature" - Sodom and Gomorrah
260 // (Depreciated) "Patriotic Nigra Testing Sandbox" - Abandon Hope All Ye Who Enter Here 260 // (Depreciated) "Patriotic Nigra Testing Sandbox" - Abandon Hope All Ye Who Enter Here
261 if ((scene.RegionInfo.EstateSettings.simAccess & Simulator.SimAccess.Mature) == Simulator.SimAccess.Mature) 261 if (scene.RegionInfo.RegionSettings.Maturity == 1)
262 { 262 {
263 return "Mature"; 263 return "Mature";
264 } 264 }
265 else if ((scene.RegionInfo.EstateSettings.simAccess & Simulator.SimAccess.PG) == Simulator.SimAccess.PG) 265 else if (scene.RegionInfo.RegionSettings.Maturity == 0)
266 { 266 {
267 return "PG"; 267 return "PG";
268 } 268 }
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 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenSim.Framework;
30using libsecondlife;
31
32namespace OpenSim.Region.Environment.Interfaces
33{
34 public interface IEstateModule : IRegionModule
35 {
36 uint GetRegionFlags();
37 }
38}
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;
37 37
38namespace OpenSim.Region.Environment.Modules.World.Estate 38namespace OpenSim.Region.Environment.Modules.World.Estate
39{ 39{
40 public class EstateManagementModule : IRegionModule 40 public class EstateManagementModule : IEstateModule
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
@@ -57,50 +57,46 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
57 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, 57 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
58 int matureLevel, bool restrictPushObject, bool allowParcelChanges) 58 int matureLevel, bool restrictPushObject, bool allowParcelChanges)
59 { 59 {
60 m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None;
61
62 if (blockTerraform) 60 if (blockTerraform)
63 { 61 m_scene.RegionInfo.RegionSettings.BlockTerraform = true;
64 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 62 else
65 Simulator.RegionFlags.BlockTerraform; 63 m_scene.RegionInfo.RegionSettings.BlockTerraform = false;
66 }
67 64
68 if (noFly) 65 if (noFly)
69 { 66 m_scene.RegionInfo.RegionSettings.BlockFly = true;
70 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 67 else
71 Simulator.RegionFlags.NoFly; 68 m_scene.RegionInfo.RegionSettings.BlockFly = false;
72 }
73 69
74 if (allowDamage) 70 if (allowDamage)
75 { 71 m_scene.RegionInfo.RegionSettings.AllowDamage = true;
76 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 72 else
77 Simulator.RegionFlags.AllowDamage; 73 m_scene.RegionInfo.RegionSettings.AllowDamage = false;
78 }
79 74
80 if (blockLandResell) 75 if (blockLandResell)
81 { 76 m_scene.RegionInfo.RegionSettings.AllowLandResell = false;
82 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 77 else
83 Simulator.RegionFlags.BlockLandResell; 78 m_scene.RegionInfo.RegionSettings.AllowLandResell = true;
84 }
85
86 m_scene.RegionInfo.EstateSettings.maxAgents = (byte) maxAgents;
87 79
88 m_scene.RegionInfo.EstateSettings.objectBonusFactor = objectBonusFactor; 80 m_scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents;
89 81
90 m_scene.RegionInfo.EstateSettings.simAccess = (Simulator.SimAccess) matureLevel; 82 m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor;
91 83
84 if(matureLevel <= 13)
85 m_scene.RegionInfo.RegionSettings.Maturity = 0;
86 else
87 m_scene.RegionInfo.RegionSettings.Maturity = 1;
92 88
93 if (restrictPushObject) 89 if (restrictPushObject)
94 { 90 m_scene.RegionInfo.RegionSettings.RestrictPushing = true;
95 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 91 else
96 Simulator.RegionFlags.RestrictPushObject; 92 m_scene.RegionInfo.RegionSettings.RestrictPushing = false;
97 }
98 93
99 if (allowParcelChanges) 94 if (allowParcelChanges)
100 { 95 m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true;
101 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 96 else
102 Simulator.RegionFlags.AllowParcelChanges; 97 m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false;
103 } 98
99 m_scene.RegionInfo.RegionSettings.Save();
104 100
105 sendRegionInfoPacketToAll(); 101 sendRegionInfoPacketToAll();
106 } 102 }
@@ -175,19 +171,20 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
175 bool UseFixedSun, float SunHour) 171 bool UseFixedSun, float SunHour)
176 { 172 {
177 // Water Height 173 // Water Height
178 m_scene.RegionInfo.EstateSettings.waterHeight = WaterHeight; 174 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
179 175
180 // Terraforming limits 176 // Terraforming limits
181 m_scene.RegionInfo.EstateSettings.terrainRaiseLimit = TerrainRaiseLimit; 177 m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit;
182 m_scene.RegionInfo.EstateSettings.terrainLowerLimit = TerrainLowerLimit; 178 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit;
183 179
184 // Time of day / fixed sun 180 // Time of day / fixed sun
185 m_scene.RegionInfo.EstateSettings.useFixedSun = UseFixedSun; 181 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
186 m_scene.RegionInfo.EstateSettings.sunHour = SunHour; 182 m_scene.RegionInfo.EstateSettings.sunHour = SunHour;
187 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour); 183 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour);
188 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); 184 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
189 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); 185 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
190 sendRegionInfoPacketToAll(); 186 sendRegionInfoPacketToAll();
187 m_scene.RegionInfo.RegionSettings.Save();
191 } 188 }
192 189
193 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) 190 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
@@ -339,23 +336,22 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
339 private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics) 336 private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics)
340 { 337 {
341 if (physics) 338 if (physics)
342 { 339 m_scene.RegionInfo.RegionSettings.DisablePhysics = true;
343 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics;
344 }
345 else 340 else
346 { 341 m_scene.RegionInfo.RegionSettings.DisablePhysics = false;
347 m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipPhysics;
348 }
349 342
350 if (scripted) 343 if (scripted)
351 { 344 m_scene.RegionInfo.RegionSettings.DisableScripts = true;
352 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipScripts;
353 }
354 else 345 else
355 { 346 m_scene.RegionInfo.RegionSettings.DisableScripts = false;
356 m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipScripts; 347
357 } 348 if (collisionEvents)
349 m_scene.RegionInfo.RegionSettings.DisableCollisions = true;
350 else
351 m_scene.RegionInfo.RegionSettings.DisableCollisions = false;
352
358 353
354 m_scene.RegionInfo.RegionSettings.Save();
359 355
360 m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); 356 m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
361 } 357 }
@@ -378,24 +374,27 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
378 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); 374 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs();
379 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; 375 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor;
380 args.estateID = m_scene.RegionInfo.EstateSettings.estateID; 376 args.estateID = m_scene.RegionInfo.EstateSettings.estateID;
381 args.maxAgents = m_scene.RegionInfo.EstateSettings.maxAgents; 377 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit;
382 args.objectBonusFactor = m_scene.RegionInfo.EstateSettings.objectBonusFactor; 378 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus;
383 args.parentEstateID = m_scene.RegionInfo.EstateSettings.parentEstateID; 379 args.parentEstateID = m_scene.RegionInfo.EstateSettings.parentEstateID;
384 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.pricePerMeter; 380 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.pricePerMeter;
385 args.redirectGridX = m_scene.RegionInfo.EstateSettings.redirectGridX; 381 args.redirectGridX = m_scene.RegionInfo.EstateSettings.redirectGridX;
386 args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY; 382 args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY;
387 args.regionFlags = (uint)(m_scene.RegionInfo.EstateSettings.regionFlags); 383 args.regionFlags = GetRegionFlags();
388 args.simAccess = (byte)m_scene.RegionInfo.EstateSettings.simAccess; 384 byte mature = 13;
385 if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
386 mature = 21;
387 args.simAccess = mature;
389 388
390 if (m_scene.RegionInfo.EstateSettings.useFixedSun) 389 if (m_scene.RegionInfo.RegionSettings.FixedSun)
391 args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour; 390 args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour;
392 else 391 else
393 args.sunHour = m_scene.EventManager.GetSunLindenHour(); 392 args.sunHour = m_scene.EventManager.GetSunLindenHour();
394 393
395 args.terrainLowerLimit = m_scene.RegionInfo.EstateSettings.terrainLowerLimit; 394 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit;
396 args.terrainRaiseLimit = m_scene.RegionInfo.EstateSettings.terrainRaiseLimit; 395 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
397 args.useEstateSun = !m_scene.RegionInfo.EstateSettings.useFixedSun; 396 args.useEstateSun = !m_scene.RegionInfo.RegionSettings.FixedSun;
398 args.waterHeight = m_scene.RegionInfo.EstateSettings.waterHeight; 397 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
399 args.simName = m_scene.RegionInfo.RegionName; 398 args.simName = m_scene.RegionInfo.RegionName;
400 399
401 400
@@ -541,10 +540,13 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
541 args.terrainStartHeight1 = m_scene.RegionInfo.EstateSettings.terrainStartHeight1; 540 args.terrainStartHeight1 = m_scene.RegionInfo.EstateSettings.terrainStartHeight1;
542 args.terrainStartHeight2 = m_scene.RegionInfo.EstateSettings.terrainStartHeight2; 541 args.terrainStartHeight2 = m_scene.RegionInfo.EstateSettings.terrainStartHeight2;
543 args.terrainStartHeight3 = m_scene.RegionInfo.EstateSettings.terrainStartHeight3; 542 args.terrainStartHeight3 = m_scene.RegionInfo.EstateSettings.terrainStartHeight3;
544 args.simAccess = (byte)m_scene.RegionInfo.EstateSettings.simAccess; 543 byte mature = 13;
545 args.waterHeight = m_scene.RegionInfo.EstateSettings.waterHeight; 544 if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
545 mature = 21;
546 args.simAccess = mature;
547 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
546 548
547 args.regionFlags = (uint)m_scene.RegionInfo.EstateSettings.regionFlags; 549 args.regionFlags = GetRegionFlags();
548 args.regionName = m_scene.RegionInfo.RegionName; 550 args.regionName = m_scene.RegionInfo.RegionName;
549 args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; 551 args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
550 args.terrainBase0 = m_scene.RegionInfo.EstateSettings.terrainBase0; 552 args.terrainBase0 = m_scene.RegionInfo.EstateSettings.terrainBase0;
@@ -573,6 +575,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
573 public void Initialise(Scene scene, IConfigSource source) 575 public void Initialise(Scene scene, IConfigSource source)
574 { 576 {
575 m_scene = scene; 577 m_scene = scene;
578 m_scene.RegisterModuleInterface<IEstateModule>(this);
576 m_scene.EventManager.OnNewClient += EventManager_OnNewClient; 579 m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
577 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; 580 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
578 } 581 }
@@ -602,8 +605,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
602 605
603 public void changeWaterHeight(float height) 606 public void changeWaterHeight(float height)
604 { 607 {
605 setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit, 608 setRegionTerrainSettings(height, (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit,
606 m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour); 609 m_scene.RegionInfo.RegionSettings.FixedSun, m_scene.RegionInfo.EstateSettings.sunHour);
607 sendRegionInfoPacketToAll(); 610 sendRegionInfoPacketToAll();
608 } 611 }
609 612
@@ -631,5 +634,12 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
631 client.OnLandStatRequest += HandleLandStatRequest; 634 client.OnLandStatRequest += HandleLandStatRequest;
632 sendRegionHandshake(client); 635 sendRegionHandshake(client);
633 } 636 }
637
638 public uint GetRegionFlags()
639 {
640 Simulator.RegionFlags flags = Simulator.RegionFlags.None;
641 //m_scene.RegionInfo.RegionSettings.
642 return (uint)flags;
643 }
634 } 644 }
635} 645}
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
140 //Normal Calculations 140 //Normal Calculations
141 return Convert.ToInt32( 141 return Convert.ToInt32(
142 Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * 142 Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
143 Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor))); ; 143 Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ;
144 } 144 }
145 } 145 }
146 public int getSimulatorMaxPrimCount(ILandObject thisObject) 146 public int getSimulatorMaxPrimCount(ILandObject thisObject)
@@ -161,7 +161,15 @@ namespace OpenSim.Region.Environment.Modules.World.Land
161 161
162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
163 { 163 {
164 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); 164 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
165 uint regionFlags = 67108864;
166 if(estateModule != null)
167 regionFlags = estateModule.GetRegionFlags();
168 remote_client.SendLandProperties(remote_client, sequence_id,
169 snap_selection, request_result, landData,
170 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
171 getParcelMaxPrimCount(this),
172 getSimulatorMaxPrimCount(this), regionFlags);
165 } 173 }
166 174
167 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 175 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
@@ -855,4 +863,4 @@ namespace OpenSim.Region.Environment.Modules.World.Land
855 863
856 #endregion 864 #endregion
857 } 865 }
858} \ No newline at end of file 866}
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
541 private bool LimitChannelChanges(int xStart, int yStart) 541 private bool LimitChannelChanges(int xStart, int yStart)
542 { 542 {
543 bool changesLimited = false; 543 bool changesLimited = false;
544 double minDelta = m_scene.RegionInfo.EstateSettings.terrainLowerLimit; 544 double minDelta = m_scene.RegionInfo.RegionSettings.TerrainLowerLimit;
545 double maxDelta = m_scene.RegionInfo.EstateSettings.terrainRaiseLimit; 545 double maxDelta = m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
546 546
547 // loop through the height map for this patch and compare it against 547 // loop through the height map for this patch and compare it against
548 // the revert map 548 // 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
297 m_httpListener = httpServer; 297 m_httpListener = httpServer;
298 m_dumpAssetsToFile = dumpAssetsToFile; 298 m_dumpAssetsToFile = dumpAssetsToFile;
299 299
300 if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts) 300 m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts;
301 { 301
302 m_scripts_enabled = false; 302 m_physics_enabled = !RegionInfo.RegionSettings.DisablePhysics;
303 }
304 else
305 {
306 m_scripts_enabled = true;
307 }
308 if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipPhysics) == Simulator.RegionFlags.SkipPhysics)
309 {
310 m_physics_enabled = false;
311 }
312 else
313 {
314 m_physics_enabled = true;
315 }
316 303
317 m_statsReporter = new SimStatsReporter(regInfo); 304 m_statsReporter = new SimStatsReporter(this);
318 m_statsReporter.OnSendStatsResult += SendSimStatsPackets; 305 m_statsReporter.OnSendStatsResult += SendSimStatsPackets;
319 306
320 m_statsReporter.SetObjectCapacity(objectCapacity); 307 m_statsReporter.SetObjectCapacity(objectCapacity);
@@ -1076,7 +1063,7 @@ namespace OpenSim.Region.Environment.Scenes
1076 //float tmpval = (float)hm[x, y]; 1063 //float tmpval = (float)hm[x, y];
1077 float heightvalue = (float)hm[x, y]; 1064 float heightvalue = (float)hm[x, y];
1078 1065
1079 if ((float)heightvalue > m_regInfo.EstateSettings.waterHeight) 1066 if (heightvalue > (float)m_regInfo.RegionSettings.WaterHeight)
1080 { 1067 {
1081 // scale height value 1068 // scale height value
1082 heightvalue = low + mid * (heightvalue - low) / mid; 1069 heightvalue = low + mid * (heightvalue - low) / mid;
@@ -1110,7 +1097,7 @@ namespace OpenSim.Region.Environment.Scenes
1110 else 1097 else
1111 { 1098 {
1112 // Y flip the cordinates 1099 // Y flip the cordinates
1113 heightvalue = m_regInfo.EstateSettings.waterHeight - heightvalue; 1100 heightvalue = (float)m_regInfo.RegionSettings.WaterHeight - heightvalue;
1114 if (heightvalue > 19) 1101 if (heightvalue > 19)
1115 heightvalue = 19; 1102 heightvalue = 19;
1116 if (heightvalue < 0) 1103 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
58 public void CreateScriptInstances(int startParam, bool postOnRez) 58 public void CreateScriptInstances(int startParam, bool postOnRez)
59 { 59 {
60 // Don't start scripts if they're turned off in the region! 60 // Don't start scripts if they're turned off in the region!
61 if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) 61 if (!m_scene.RegionInfo.RegionSettings.DisableScripts)
62 { 62 {
63 foreach (SceneObjectPart part in m_parts.Values) 63 foreach (SceneObjectPart part in m_parts.Values)
64 { 64 {
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
173 173
174 AddFlag(LLObject.ObjectFlags.Scripted); 174 AddFlag(LLObject.ObjectFlags.Scripted);
175 175
176 if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) 176 if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
177 { 177 {
178 AssetCache cache = m_parentGroup.Scene.AssetCache; 178 AssetCache cache = m_parentGroup.Scene.AssetCache;
179 179
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;
29using System.Timers; 29using System.Timers;
30using libsecondlife.Packets; 30using libsecondlife.Packets;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Environment.Interfaces;
32 33
33namespace OpenSim.Region.Environment.Scenes 34namespace OpenSim.Region.Environment.Scenes
34{ 35{
@@ -104,16 +105,19 @@ namespace OpenSim.Region.Environment.Scenes
104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 105 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
105 106
106 107
108 private Scene m_scene;
109
107 private RegionInfo ReportingRegion; 110 private RegionInfo ReportingRegion;
108 111
109 private Timer m_report = new Timer(); 112 private Timer m_report = new Timer();
110 113
111 114
112 public SimStatsReporter(RegionInfo regionData) 115 public SimStatsReporter(Scene scene)
113 { 116 {
114 117
115 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000); 118 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000);
116 ReportingRegion = regionData; 119 m_scene = scene;
120 ReportingRegion = scene.RegionInfo;
117 for (int i = 0; i<21;i++) 121 for (int i = 0; i<21;i++)
118 { 122 {
119 sb[i] = new SimStatsPacket.StatBlock(); 123 sb[i] = new SimStatsPacket.StatBlock();
@@ -145,7 +149,8 @@ namespace OpenSim.Region.Environment.Scenes
145 statpack.Region.RegionY = ReportingRegion.RegionLocY; 149 statpack.Region.RegionY = ReportingRegion.RegionLocY;
146 try 150 try
147 { 151 {
148 statpack.Region.RegionFlags = (uint) ReportingRegion.EstateSettings.regionFlags; 152 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
153 statpack.Region.RegionFlags = estateModule.GetRegionFlags();
149 } 154 }
150 catch (Exception) 155 catch (Exception)
151 { 156 {
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
2822 public double llWater(LSL_Types.Vector3 offset) 2822 public double llWater(LSL_Types.Vector3 offset)
2823 { 2823 {
2824 m_host.AddScriptLPS(1); 2824 m_host.AddScriptLPS(1);
2825 return World.RegionInfo.EstateSettings.waterHeight; 2825 return World.RegionInfo.RegionSettings.WaterHeight;
2826 } 2826 }
2827 2827
2828 public void llPassTouches(int pass) 2828 public void llPassTouches(int pass)
@@ -6456,10 +6456,10 @@ namespace OpenSim.Region.ScriptEngine.Common
6456 case 7: // DATA_SIM_RATING 6456 case 7: // DATA_SIM_RATING
6457 if (info == null) 6457 if (info == null)
6458 return LLUUID.Zero.ToString(); 6458 return LLUUID.Zero.ToString();
6459 int access = (int)info.EstateSettings.simAccess; 6459 int access = info.RegionSettings.Maturity;
6460 if (access == 21) 6460 if (access == 0)
6461 reply = "MATURE"; 6461 reply = "PG";
6462 else if (access == 13) 6462 else if (access == 1)
6463 reply = "MATURE"; 6463 reply = "MATURE";
6464 else 6464 else
6465 reply = "UNKNOWN"; 6465 reply = "UNKNOWN";
@@ -6829,7 +6829,10 @@ namespace OpenSim.Region.ScriptEngine.Common
6829 public LSL_Types.LSLInteger llGetRegionFlags() 6829 public LSL_Types.LSLInteger llGetRegionFlags()
6830 { 6830 {
6831 m_host.AddScriptLPS(1); 6831 m_host.AddScriptLPS(1);
6832 return (int)World.RegionInfo.EstateSettings.regionFlags; 6832 IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
6833 if(estate == null)
6834 return 67108864;
6835 return estate.GetRegionFlags();
6833 } 6836 }
6834 6837
6835 public string llXorBase64StringsCorrect(string str1, string str2) 6838 public string llXorBase64StringsCorrect(string str1, string str2)
@@ -7006,7 +7009,7 @@ namespace OpenSim.Region.ScriptEngine.Common
7006 // Which probably will be irrelevent in OpenSim.... 7009 // Which probably will be irrelevent in OpenSim....
7007 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 7010 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
7008 7011
7009 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; 7012 float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus;
7010 7013
7011 if (land == null) 7014 if (land == null)
7012 { 7015 {
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
2686 public double llWater(LSL_Types.Vector3 offset) 2686 public double llWater(LSL_Types.Vector3 offset)
2687 { 2687 {
2688 m_host.AddScriptLPS(1); 2688 m_host.AddScriptLPS(1);
2689 return World.RegionInfo.EstateSettings.waterHeight; 2689 return World.RegionInfo.RegionSettings.WaterHeight;
2690 } 2690 }
2691 2691
2692 public void llPassTouches(int pass) 2692 public void llPassTouches(int pass)
@@ -6235,10 +6235,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6235 case 7: // DATA_SIM_RATING 6235 case 7: // DATA_SIM_RATING
6236 if (info == null) 6236 if (info == null)
6237 return LLUUID.Zero.ToString(); 6237 return LLUUID.Zero.ToString();
6238 int access = (int)info.EstateSettings.simAccess; 6238 int access = info.RegionSettings.Maturity;
6239 if (access == 21) 6239 if (access == 0)
6240 reply = "MATURE"; 6240 reply = "PG";
6241 else if (access == 13) 6241 else if (access == 1)
6242 reply = "MATURE"; 6242 reply = "MATURE";
6243 else 6243 else
6244 reply = "UNKNOWN"; 6244 reply = "UNKNOWN";
@@ -6609,7 +6609,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6609 public LSL_Types.LSLInteger llGetRegionFlags() 6609 public LSL_Types.LSLInteger llGetRegionFlags()
6610 { 6610 {
6611 m_host.AddScriptLPS(1); 6611 m_host.AddScriptLPS(1);
6612 return (int)World.RegionInfo.EstateSettings.regionFlags; 6612 IEstateModule estate = World.RequestModuleInterface<IEstateModule>();
6613 if(estate == null)
6614 return 67108864;
6615 return (int)estate.GetRegionFlags();
6613 } 6616 }
6614 6617
6615 public string llXorBase64StringsCorrect(string str1, string str2) 6618 public string llXorBase64StringsCorrect(string str1, string str2)
@@ -6786,7 +6789,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6786 // Which probably will be irrelevent in OpenSim.... 6789 // Which probably will be irrelevent in OpenSim....
6787 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 6790 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
6788 6791
6789 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; 6792 float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus;
6790 6793
6791 if (land == null) 6794 if (land == null)
6792 { 6795 {