aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorlbsa712007-10-22 17:55:49 +0000
committerlbsa712007-10-22 17:55:49 +0000
commitdd770c384c2e63cf8a1e2f522741afb8adfab4c2 (patch)
tree97bc7dacf15388d8b32639219ea51872961de2cd /OpenSim/Region/Environment
parentafter a small misunderstanding with the match group numbers (diff)
downloadopensim-SC_OLD-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.zip
opensim-SC_OLD-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.tar.gz
opensim-SC_OLD-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.tar.bz2
opensim-SC_OLD-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.tar.xz
* Made EstateSetting static since there's only one instance, and we only need to create it once
* Now cacheing RegionInfos indefinitively; we should add a tiomeout to this cache
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs92
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
3 files changed, 66 insertions, 58 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 97e25d5..cb403a7 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -73,20 +73,20 @@ namespace OpenSim.Region.Environment
73 switch (corner) 73 switch (corner)
74 { 74 {
75 case 0: 75 case 0:
76 m_regInfo.estateSettings.terrainStartHeight0 = lowValue; 76 m_regInfo.EstateSettings.terrainStartHeight0 = lowValue;
77 m_regInfo.estateSettings.terrainHeightRange0 = highValue; 77 m_regInfo.EstateSettings.terrainHeightRange0 = highValue;
78 break; 78 break;
79 case 1: 79 case 1:
80 m_regInfo.estateSettings.terrainStartHeight1 = lowValue; 80 m_regInfo.EstateSettings.terrainStartHeight1 = lowValue;
81 m_regInfo.estateSettings.terrainHeightRange1 = highValue; 81 m_regInfo.EstateSettings.terrainHeightRange1 = highValue;
82 break; 82 break;
83 case 2: 83 case 2:
84 m_regInfo.estateSettings.terrainStartHeight2 = lowValue; 84 m_regInfo.EstateSettings.terrainStartHeight2 = lowValue;
85 m_regInfo.estateSettings.terrainHeightRange2 = highValue; 85 m_regInfo.EstateSettings.terrainHeightRange2 = highValue;
86 break; 86 break;
87 case 3: 87 case 3:
88 m_regInfo.estateSettings.terrainStartHeight3 = lowValue; 88 m_regInfo.EstateSettings.terrainStartHeight3 = lowValue;
89 m_regInfo.estateSettings.terrainHeightRange3 = highValue; 89 m_regInfo.EstateSettings.terrainHeightRange3 = highValue;
90 break; 90 break;
91 } 91 }
92 } 92 }
@@ -101,16 +101,16 @@ namespace OpenSim.Region.Environment
101 switch (band) 101 switch (band)
102 { 102 {
103 case 0: 103 case 0:
104 m_regInfo.estateSettings.terrainDetail0 = textureUUID; 104 m_regInfo.EstateSettings.terrainDetail0 = textureUUID;
105 break; 105 break;
106 case 1: 106 case 1:
107 m_regInfo.estateSettings.terrainDetail1 = textureUUID; 107 m_regInfo.EstateSettings.terrainDetail1 = textureUUID;
108 break; 108 break;
109 case 2: 109 case 2:
110 m_regInfo.estateSettings.terrainDetail2 = textureUUID; 110 m_regInfo.EstateSettings.terrainDetail2 = textureUUID;
111 break; 111 break;
112 case 3: 112 case 3:
113 m_regInfo.estateSettings.terrainDetail3 = textureUUID; 113 m_regInfo.EstateSettings.terrainDetail3 = textureUUID;
114 break; 114 break;
115 } 115 }
116 } 116 }
@@ -127,18 +127,18 @@ namespace OpenSim.Region.Environment
127 bool UseFixedSun, float SunHour) 127 bool UseFixedSun, float SunHour)
128 { 128 {
129 // Water Height 129 // Water Height
130 m_regInfo.estateSettings.waterHeight = WaterHeight; 130 m_regInfo.EstateSettings.waterHeight = WaterHeight;
131 m_scene.Terrain.watermap.Fill(WaterHeight); 131 m_scene.Terrain.watermap.Fill(WaterHeight);
132 132
133 // Terraforming limits 133 // Terraforming limits
134 m_regInfo.estateSettings.terrainRaiseLimit = TerrainRaiseLimit; 134 m_regInfo.EstateSettings.terrainRaiseLimit = TerrainRaiseLimit;
135 m_regInfo.estateSettings.terrainLowerLimit = TerrainLowerLimit; 135 m_regInfo.EstateSettings.terrainLowerLimit = TerrainLowerLimit;
136 m_scene.Terrain.maxRaise = TerrainRaiseLimit; 136 m_scene.Terrain.maxRaise = TerrainRaiseLimit;
137 m_scene.Terrain.minLower = TerrainLowerLimit; 137 m_scene.Terrain.minLower = TerrainLowerLimit;
138 138
139 // Time of day / fixed sun 139 // Time of day / fixed sun
140 m_regInfo.estateSettings.useFixedSun = UseFixedSun; 140 m_regInfo.EstateSettings.useFixedSun = UseFixedSun;
141 m_regInfo.estateSettings.sunHour = SunHour; 141 m_regInfo.EstateSettings.sunHour = SunHour;
142 } 142 }
143 143
144 #region Packet Handlers 144 #region Packet Handlers
@@ -187,54 +187,54 @@ namespace OpenSim.Region.Environment
187 } 187 }
188 else 188 else
189 { 189 {
190 m_regInfo.estateSettings.regionFlags = Simulator.RegionFlags.None; 190 m_regInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None;
191 191
192 if (convertParamStringToBool(packet.ParamList[0].Parameter)) 192 if (convertParamStringToBool(packet.ParamList[0].Parameter))
193 { 193 {
194 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 194 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
195 Simulator.RegionFlags.BlockTerraform; 195 Simulator.RegionFlags.BlockTerraform;
196 } 196 }
197 197
198 if (convertParamStringToBool(packet.ParamList[1].Parameter)) 198 if (convertParamStringToBool(packet.ParamList[1].Parameter))
199 { 199 {
200 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 200 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
201 Simulator.RegionFlags.NoFly; 201 Simulator.RegionFlags.NoFly;
202 } 202 }
203 203
204 if (convertParamStringToBool(packet.ParamList[2].Parameter)) 204 if (convertParamStringToBool(packet.ParamList[2].Parameter))
205 { 205 {
206 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 206 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
207 Simulator.RegionFlags.AllowDamage; 207 Simulator.RegionFlags.AllowDamage;
208 } 208 }
209 209
210 if (convertParamStringToBool(packet.ParamList[3].Parameter) == false) 210 if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
211 { 211 {
212 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 212 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
213 Simulator.RegionFlags.BlockLandResell; 213 Simulator.RegionFlags.BlockLandResell;
214 } 214 }
215 215
216 216
217 int tempMaxAgents = 217 int tempMaxAgents =
218 Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter))); 218 Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
219 m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents; 219 m_regInfo.EstateSettings.maxAgents = (byte)tempMaxAgents;
220 220
221 float tempObjectBonusFactor = 221 float tempObjectBonusFactor =
222 (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); 222 (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
223 m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor; 223 m_regInfo.EstateSettings.objectBonusFactor = tempObjectBonusFactor;
224 224
225 int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter)); 225 int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
226 m_regInfo.estateSettings.simAccess = (Simulator.SimAccess)tempMatureLevel; 226 m_regInfo.EstateSettings.simAccess = (Simulator.SimAccess)tempMatureLevel;
227 227
228 228
229 if (convertParamStringToBool(packet.ParamList[7].Parameter)) 229 if (convertParamStringToBool(packet.ParamList[7].Parameter))
230 { 230 {
231 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 231 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
232 Simulator.RegionFlags.RestrictPushObject; 232 Simulator.RegionFlags.RestrictPushObject;
233 } 233 }
234 234
235 if (convertParamStringToBool(packet.ParamList[8].Parameter)) 235 if (convertParamStringToBool(packet.ParamList[8].Parameter))
236 { 236 {
237 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | 237 m_regInfo.EstateSettings.regionFlags = m_regInfo.EstateSettings.regionFlags |
238 Simulator.RegionFlags.AllowParcelChanges; 238 Simulator.RegionFlags.AllowParcelChanges;
239 } 239 }
240 240
@@ -309,16 +309,16 @@ namespace OpenSim.Region.Environment
309 switch (Convert.ToInt16(splitField[0])) 309 switch (Convert.ToInt16(splitField[0]))
310 { 310 {
311 case 0: 311 case 0:
312 m_regInfo.estateSettings.terrainBase0 = tempUUID; 312 m_regInfo.EstateSettings.terrainBase0 = tempUUID;
313 break; 313 break;
314 case 1: 314 case 1:
315 m_regInfo.estateSettings.terrainBase1 = tempUUID; 315 m_regInfo.EstateSettings.terrainBase1 = tempUUID;
316 break; 316 break;
317 case 2: 317 case 2:
318 m_regInfo.estateSettings.terrainBase2 = tempUUID; 318 m_regInfo.EstateSettings.terrainBase2 = tempUUID;
319 break; 319 break;
320 case 3: 320 case 3:
321 m_regInfo.estateSettings.terrainBase3 = tempUUID; 321 m_regInfo.EstateSettings.terrainBase3 = tempUUID;
322 break; 322 break;
323 } 323 }
324 } 324 }
@@ -355,22 +355,22 @@ namespace OpenSim.Region.Environment
355 RegionInfoPacket regionInfoPacket = new RegionInfoPacket(); 355 RegionInfoPacket regionInfoPacket = new RegionInfoPacket();
356 regionInfoPacket.AgentData.AgentID = circuitData.AgentID; 356 regionInfoPacket.AgentData.AgentID = circuitData.AgentID;
357 regionInfoPacket.AgentData.SessionID = circuitData.SessionID; 357 regionInfoPacket.AgentData.SessionID = circuitData.SessionID;
358 regionInfoPacket.RegionInfo.BillableFactor = m_regInfo.estateSettings.billableFactor; 358 regionInfoPacket.RegionInfo.BillableFactor = m_regInfo.EstateSettings.billableFactor;
359 regionInfoPacket.RegionInfo.EstateID = m_regInfo.estateSettings.estateID; 359 regionInfoPacket.RegionInfo.EstateID = m_regInfo.EstateSettings.estateID;
360 regionInfoPacket.RegionInfo.MaxAgents = m_regInfo.estateSettings.maxAgents; 360 regionInfoPacket.RegionInfo.MaxAgents = m_regInfo.EstateSettings.maxAgents;
361 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_regInfo.estateSettings.objectBonusFactor; 361 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_regInfo.EstateSettings.objectBonusFactor;
362 regionInfoPacket.RegionInfo.ParentEstateID = m_regInfo.estateSettings.parentEstateID; 362 regionInfoPacket.RegionInfo.ParentEstateID = m_regInfo.EstateSettings.parentEstateID;
363 regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.estateSettings.pricePerMeter; 363 regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.EstateSettings.pricePerMeter;
364 regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.estateSettings.redirectGridX; 364 regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.EstateSettings.redirectGridX;
365 regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.estateSettings.redirectGridY; 365 regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.EstateSettings.redirectGridY;
366 regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags; 366 regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.EstateSettings.regionFlags;
367 regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess; 367 regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.EstateSettings.simAccess;
368 regionInfoPacket.RegionInfo.SimName = _enc.GetBytes(m_regInfo.RegionName); 368 regionInfoPacket.RegionInfo.SimName = _enc.GetBytes(m_regInfo.RegionName);
369 regionInfoPacket.RegionInfo.SunHour = m_regInfo.estateSettings.sunHour; 369 regionInfoPacket.RegionInfo.SunHour = m_regInfo.EstateSettings.sunHour;
370 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.estateSettings.terrainLowerLimit; 370 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.EstateSettings.terrainLowerLimit;
371 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.estateSettings.terrainRaiseLimit; 371 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.EstateSettings.terrainRaiseLimit;
372 regionInfoPacket.RegionInfo.UseEstateSun = !m_regInfo.estateSettings.useFixedSun; 372 regionInfoPacket.RegionInfo.UseEstateSun = !m_regInfo.EstateSettings.useFixedSun;
373 regionInfoPacket.RegionInfo.WaterHeight = m_regInfo.estateSettings.waterHeight; 373 regionInfoPacket.RegionInfo.WaterHeight = m_regInfo.EstateSettings.waterHeight;
374 374
375 remote_client.OutPacket(regionInfoPacket); 375 remote_client.OutPacket(regionInfoPacket);
376 } 376 }
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 0acafa7..7fb2221 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Environment.LandManagement
135 updatePacket.ParcelData.MaxPrims = 135 updatePacket.ParcelData.MaxPrims =
136 Convert.ToInt32( 136 Convert.ToInt32(
137 Math.Round((Convert.ToDecimal(landData.area)/Convert.ToDecimal(65536))*15000* 137 Math.Round((Convert.ToDecimal(landData.area)/Convert.ToDecimal(65536))*15000*
138 Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); 138 Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor)));
139 } 139 }
140 else 140 else
141 { 141 {
@@ -152,12 +152,12 @@ namespace OpenSim.Region.Environment.LandManagement
152 updatePacket.ParcelData.OwnerID = landData.ownerID; 152 updatePacket.ParcelData.OwnerID = landData.ownerID;
153 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims; 153 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
154 updatePacket.ParcelData.ParcelFlags = landData.landFlags; 154 updatePacket.ParcelData.ParcelFlags = landData.landFlags;
155 updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor; 155 updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.EstateSettings.objectBonusFactor;
156 updatePacket.ParcelData.PassHours = landData.passHours; 156 updatePacket.ParcelData.PassHours = landData.passHours;
157 updatePacket.ParcelData.PassPrice = landData.passPrice; 157 updatePacket.ParcelData.PassPrice = landData.passPrice;
158 updatePacket.ParcelData.PublicCount = 0; //unemplemented 158 updatePacket.ParcelData.PublicCount = 0; //unemplemented
159 159
160 uint regionFlags = (uint) m_scene.RegionInfo.estateSettings.regionFlags; 160 uint regionFlags = (uint) m_scene.RegionInfo.EstateSettings.regionFlags;
161 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) > 161 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) >
162 0); 162 0);
163 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) > 163 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) >
@@ -178,7 +178,7 @@ namespace OpenSim.Region.Environment.LandManagement
178 updatePacket.ParcelData.SimWideMaxPrims = 178 updatePacket.ParcelData.SimWideMaxPrims =
179 Convert.ToInt32( 179 Convert.ToInt32(
180 Math.Round((Convert.ToDecimal(landData.simwideArea)/Convert.ToDecimal(65536))*15000* 180 Math.Round((Convert.ToDecimal(landData.simwideArea)/Convert.ToDecimal(65536))*15000*
181 Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); 181 Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor)));
182 } 182 }
183 else 183 else
184 { 184 {
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 553e55f..e2430f8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -469,7 +469,7 @@ namespace OpenSim.Region.Environment.Scenes
469 double[,] map = storageManager.DataStore.LoadTerrain(); 469 double[,] map = storageManager.DataStore.LoadTerrain();
470 if (map == null) 470 if (map == null)
471 { 471 {
472 if (string.IsNullOrEmpty(m_regInfo.estateSettings.terrainFile)) 472 if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile))
473 { 473 {
474 MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain."); 474 MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain.");
475 Terrain.HillsGenerator(); 475 Terrain.HillsGenerator();
@@ -480,8 +480,8 @@ namespace OpenSim.Region.Environment.Scenes
480 { 480 {
481 try 481 try
482 { 482 {
483 Terrain.LoadFromFileF32(m_regInfo.estateSettings.terrainFile); 483 Terrain.LoadFromFileF32(m_regInfo.EstateSettings.terrainFile);
484 Terrain *= m_regInfo.estateSettings.terrainMultiplier; 484 Terrain *= m_regInfo.EstateSettings.terrainMultiplier;
485 } 485 }
486 catch 486 catch
487 { 487 {
@@ -511,9 +511,9 @@ namespace OpenSim.Region.Environment.Scenes
511 { 511 {
512 //create a texture asset of the terrain 512 //create a texture asset of the terrain
513 byte[] data = Terrain.ExportJpegImage("defaultstripe.png"); 513 byte[] data = Terrain.ExportJpegImage("defaultstripe.png");
514 m_regInfo.estateSettings.terrainImageID = LLUUID.Random(); 514 m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
515 AssetBase asset = new AssetBase(); 515 AssetBase asset = new AssetBase();
516 asset.FullID = m_regInfo.estateSettings.terrainImageID; 516 asset.FullID = m_regInfo.EstateSettings.terrainImageID;
517 asset.Data = data; 517 asset.Data = data;
518 asset.Name = "terrainImage"; 518 asset.Name = "terrainImage";
519 asset.Type = 0; 519 asset.Type = 0;
@@ -1001,12 +1001,20 @@ namespace OpenSim.Region.Environment.Scenes
1001 /// <summary> 1001 /// <summary>
1002 /// 1002 ///
1003 /// </summary> 1003 /// </summary>
1004 /// <param name="whatToDo"></param> 1004 /// <param name="action"></param>
1005 public void ForEachScenePresence(Action<ScenePresence> whatToDo) 1005 public void ForEachScenePresence(Action<ScenePresence> action)
1006 { 1006 {
1007 foreach (ScenePresence presence in m_scenePresences.Values) 1007 foreach (ScenePresence presence in m_scenePresences.Values)
1008 { 1008 {
1009 whatToDo(presence); 1009 action(presence);
1010 }
1011 }
1012
1013 public void ForEachObject(Action<SceneObjectGroup> action)
1014 {
1015 foreach (SceneObjectGroup presence in m_sceneObjects.Values)
1016 {
1017 action(presence);
1010 } 1018 }
1011 } 1019 }
1012 1020