aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorlbsa712007-10-22 17:55:49 +0000
committerlbsa712007-10-22 17:55:49 +0000
commitdd770c384c2e63cf8a1e2f522741afb8adfab4c2 (patch)
tree97bc7dacf15388d8b32639219ea51872961de2cd /OpenSim/Region
parentafter a small misunderstanding with the match group numbers (diff)
downloadopensim-SC-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.zip
opensim-SC-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.tar.gz
opensim-SC-dd770c384c2e63cf8a1e2f522741afb8adfab4c2.tar.bz2
opensim-SC-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')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs40
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs5
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs62
-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
6 files changed, 125 insertions, 106 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index ed3c16c..a1e4b56 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -169,32 +169,32 @@ namespace OpenSim.Region.ClientStack
169 Encoding _enc = Encoding.ASCII; 169 Encoding _enc = Encoding.ASCII;
170 RegionHandshakePacket handshake = new RegionHandshakePacket(); 170 RegionHandshakePacket handshake = new RegionHandshakePacket();
171 171
172 handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor; 172 handshake.RegionInfo.BillableFactor = regionInfo.EstateSettings.billableFactor;
173 handshake.RegionInfo.IsEstateManager = false; 173 handshake.RegionInfo.IsEstateManager = false;
174 handshake.RegionInfo.TerrainHeightRange00 = regionInfo.estateSettings.terrainHeightRange0; 174 handshake.RegionInfo.TerrainHeightRange00 = regionInfo.EstateSettings.terrainHeightRange0;
175 handshake.RegionInfo.TerrainHeightRange01 = regionInfo.estateSettings.terrainHeightRange1; 175 handshake.RegionInfo.TerrainHeightRange01 = regionInfo.EstateSettings.terrainHeightRange1;
176 handshake.RegionInfo.TerrainHeightRange10 = regionInfo.estateSettings.terrainHeightRange2; 176 handshake.RegionInfo.TerrainHeightRange10 = regionInfo.EstateSettings.terrainHeightRange2;
177 handshake.RegionInfo.TerrainHeightRange11 = regionInfo.estateSettings.terrainHeightRange3; 177 handshake.RegionInfo.TerrainHeightRange11 = regionInfo.EstateSettings.terrainHeightRange3;
178 handshake.RegionInfo.TerrainStartHeight00 = regionInfo.estateSettings.terrainStartHeight0; 178 handshake.RegionInfo.TerrainStartHeight00 = regionInfo.EstateSettings.terrainStartHeight0;
179 handshake.RegionInfo.TerrainStartHeight01 = regionInfo.estateSettings.terrainStartHeight1; 179 handshake.RegionInfo.TerrainStartHeight01 = regionInfo.EstateSettings.terrainStartHeight1;
180 handshake.RegionInfo.TerrainStartHeight10 = regionInfo.estateSettings.terrainStartHeight2; 180 handshake.RegionInfo.TerrainStartHeight10 = regionInfo.EstateSettings.terrainStartHeight2;
181 handshake.RegionInfo.TerrainStartHeight11 = regionInfo.estateSettings.terrainStartHeight3; 181 handshake.RegionInfo.TerrainStartHeight11 = regionInfo.EstateSettings.terrainStartHeight3;
182 handshake.RegionInfo.SimAccess = (byte)regionInfo.estateSettings.simAccess; 182 handshake.RegionInfo.SimAccess = (byte)regionInfo.EstateSettings.simAccess;
183 handshake.RegionInfo.WaterHeight = regionInfo.estateSettings.waterHeight; 183 handshake.RegionInfo.WaterHeight = regionInfo.EstateSettings.waterHeight;
184 184
185 185
186 handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags; 186 handshake.RegionInfo.RegionFlags = (uint)regionInfo.EstateSettings.regionFlags;
187 187
188 handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0"); 188 handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0");
189 handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID; 189 handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID;
190 handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0; 190 handshake.RegionInfo.TerrainBase0 = regionInfo.EstateSettings.terrainBase0;
191 handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1; 191 handshake.RegionInfo.TerrainBase1 = regionInfo.EstateSettings.terrainBase1;
192 handshake.RegionInfo.TerrainBase2 = regionInfo.estateSettings.terrainBase2; 192 handshake.RegionInfo.TerrainBase2 = regionInfo.EstateSettings.terrainBase2;
193 handshake.RegionInfo.TerrainBase3 = regionInfo.estateSettings.terrainBase3; 193 handshake.RegionInfo.TerrainBase3 = regionInfo.EstateSettings.terrainBase3;
194 handshake.RegionInfo.TerrainDetail0 = regionInfo.estateSettings.terrainDetail0; 194 handshake.RegionInfo.TerrainDetail0 = regionInfo.EstateSettings.terrainDetail0;
195 handshake.RegionInfo.TerrainDetail1 = regionInfo.estateSettings.terrainDetail1; 195 handshake.RegionInfo.TerrainDetail1 = regionInfo.EstateSettings.terrainDetail1;
196 handshake.RegionInfo.TerrainDetail2 = regionInfo.estateSettings.terrainDetail2; 196 handshake.RegionInfo.TerrainDetail2 = regionInfo.EstateSettings.terrainDetail2;
197 handshake.RegionInfo.TerrainDetail3 = regionInfo.estateSettings.terrainDetail3; 197 handshake.RegionInfo.TerrainDetail3 = regionInfo.EstateSettings.terrainDetail3;
198 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting? 198 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
199 199
200 this.OutPacket(handshake); 200 this.OutPacket(handshake);
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index b14bd3d..dbac148 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -39,6 +39,7 @@ namespace OpenSim.Region.Communications.Local
39 { 39 {
40 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); 40 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>();
41 protected Dictionary<ulong, RegionCommsListener> m_regionListeners = new Dictionary<ulong, RegionCommsListener>(); 41 protected Dictionary<ulong, RegionCommsListener> m_regionListeners = new Dictionary<ulong, RegionCommsListener>();
42 private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
42 43
43 public LocalBackEndServices() 44 public LocalBackEndServices()
44 { 45 {
@@ -128,8 +129,8 @@ namespace OpenSim.Region.Communications.Local
128 map.Name = regInfo.RegionName; 129 map.Name = regInfo.RegionName;
129 map.X = (ushort)regInfo.RegionLocX; 130 map.X = (ushort)regInfo.RegionLocX;
130 map.Y = (ushort)regInfo.RegionLocY; 131 map.Y = (ushort)regInfo.RegionLocY;
131 map.WaterHeight = (byte)regInfo.estateSettings.waterHeight; 132 map.WaterHeight = (byte)regInfo.EstateSettings.waterHeight;
132 map.MapImageId = regInfo.estateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007"); 133 map.MapImageId = regInfo.EstateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007");
133 map.Agents = 1; 134 map.Agents = 1;
134 map.RegionFlags = 72458694; 135 map.RegionFlags = 72458694;
135 map.Access = 13; 136 map.Access = 13;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index cc56078..9e74148 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.Communications.OGS1
50 public class OGS1GridServices : IGridServices, IInterRegionCommunications 50 public class OGS1GridServices : IGridServices, IInterRegionCommunications
51 { 51 {
52 private LocalBackEndServices m_localBackend = new LocalBackEndServices(); 52 private LocalBackEndServices m_localBackend = new LocalBackEndServices();
53 private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
53 54
54 public BaseHttpServer httpListener; 55 public BaseHttpServer httpListener;
55 public NetworkServersInfo serversInfo; 56 public NetworkServersInfo serversInfo;
@@ -89,7 +90,7 @@ namespace OpenSim.Region.Communications.OGS1
89 GridParams["sim_name"] = regionInfo.RegionName; 90 GridParams["sim_name"] = regionInfo.RegionName;
90 GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); 91 GridParams["http_port"] = serversInfo.HttpListenerPort.ToString();
91 GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString(); 92 GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString();
92 GridParams["map-image-id"] = regionInfo.estateSettings.terrainImageID.ToStringHyphenated(); 93 GridParams["map-image-id"] = regionInfo.EstateSettings.terrainImageID.ToStringHyphenated();
93 94
94 // Package into an XMLRPC Request 95 // Package into an XMLRPC Request
95 ArrayList SendParams = new ArrayList(); 96 ArrayList SendParams = new ArrayList();
@@ -152,6 +153,7 @@ namespace OpenSim.Region.Communications.OGS1
152 return neighbours; 153 return neighbours;
153 } 154 }
154 155
156
155 /// <summary> 157 /// <summary>
156 /// 158 ///
157 /// </summary> 159 /// </summary>
@@ -166,37 +168,45 @@ namespace OpenSim.Region.Communications.OGS1
166 return regionInfo; 168 return regionInfo;
167 } 169 }
168 170
169 Hashtable requestData = new Hashtable(); 171 if (m_remoteRegionInfoCache.TryGetValue(regionHandle, out regionInfo))
170 requestData["region_handle"] = regionHandle.ToString();
171 requestData["authkey"] = this.serversInfo.GridSendKey;
172 ArrayList SendParams = new ArrayList();
173 SendParams.Add(requestData);
174 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
175 XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000);
176
177 Hashtable responseData = (Hashtable)GridResp.Value;
178
179 if (responseData.ContainsKey("error"))
180 { 172 {
181 Console.WriteLine("error received from grid server" + responseData["error"]);
182 return null;
183 } 173 }
174 else
175 {
176 Hashtable requestData = new Hashtable();
177 requestData["region_handle"] = regionHandle.ToString();
178 requestData["authkey"] = this.serversInfo.GridSendKey;
179 ArrayList SendParams = new ArrayList();
180 SendParams.Add(requestData);
181 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
182 XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000);
184 183
185 uint regX = Convert.ToUInt32((string)responseData["region_locx"]); 184 Hashtable responseData = (Hashtable) GridResp.Value;
186 uint regY = Convert.ToUInt32((string)responseData["region_locy"]);
187 string internalIpStr = (string)responseData["sim_ip"];
188 uint port = Convert.ToUInt32(responseData["sim_port"]);
189 string externalUri = (string)responseData["sim_uri"];
190 185
191 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); 186 if (responseData.ContainsKey("error"))
192 string neighbourExternalUri = externalUri; 187 {
193 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); 188 Console.WriteLine("error received from grid server" + responseData["error"]);
189 return null;
190 }
191
192 uint regX = Convert.ToUInt32((string) responseData["region_locx"]);
193 uint regY = Convert.ToUInt32((string) responseData["region_locy"]);
194 string internalIpStr = (string) responseData["sim_ip"];
195 uint port = Convert.ToUInt32(responseData["sim_port"]);
196 string externalUri = (string) responseData["sim_uri"];
194 197
195 regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); 198 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port);
196 regionInfo.RemotingAddress = internalIpStr; 199 string neighbourExternalUri = externalUri;
200 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
197 201
198 regionInfo.RegionID = new LLUUID((string)responseData["region_UUID"]); 202 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
199 regionInfo.RegionName = (string)responseData["region_name"]; 203 regionInfo.RemotingAddress = internalIpStr;
204
205 regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
206 regionInfo.RegionName = (string) responseData["region_name"];
207
208 m_remoteRegionInfoCache.Add( regionHandle, regionInfo );
209 }
200 210
201 return regionInfo; 211 return regionInfo;
202 } 212 }
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