aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
13 files changed, 162 insertions, 108 deletions
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 {