diff options
Diffstat (limited to 'OpenSim/Region/Environment/EstateManager.cs')
-rw-r--r-- | OpenSim/Region/Environment/EstateManager.cs | 81 |
1 files changed, 43 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index 92e1956..30d206f 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs | |||
@@ -39,7 +39,6 @@ using Avatar = OpenSim.Region.Environment.Scenes.ScenePresence; | |||
39 | 39 | ||
40 | namespace OpenSim.Region.Environment | 40 | namespace OpenSim.Region.Environment |
41 | { | 41 | { |
42 | |||
43 | /// <summary> | 42 | /// <summary> |
44 | /// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings | 43 | /// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings |
45 | /// </summary> | 44 | /// </summary> |
@@ -48,9 +47,9 @@ namespace OpenSim.Region.Environment | |||
48 | private Scene m_scene; | 47 | private Scene m_scene; |
49 | private RegionInfo m_regInfo; | 48 | private RegionInfo m_regInfo; |
50 | 49 | ||
51 | public EstateManager(Scene scene,RegionInfo reginfo) | 50 | public EstateManager(Scene scene, RegionInfo reginfo) |
52 | { | 51 | { |
53 | m_scene = scene; | 52 | m_scene = scene; |
54 | m_regInfo = reginfo; | 53 | m_regInfo = reginfo; |
55 | } | 54 | } |
56 | 55 | ||
@@ -125,7 +124,8 @@ namespace OpenSim.Region.Environment | |||
125 | /// <param name="TerrainLowerLimit">Minimum amount terrain can be lowered from previous baking</param> | 124 | /// <param name="TerrainLowerLimit">Minimum amount terrain can be lowered from previous baking</param> |
126 | /// <param name="UseFixedSun">Use a fixed time of day on the sun?</param> | 125 | /// <param name="UseFixedSun">Use a fixed time of day on the sun?</param> |
127 | /// <param name="SunHour">The offset hour of the day</param> | 126 | /// <param name="SunHour">The offset hour of the day</param> |
128 | public void setRegionSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, bool UseFixedSun, float SunHour) | 127 | public void setRegionSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, |
128 | bool UseFixedSun, float SunHour) | ||
129 | { | 129 | { |
130 | // Water Height | 130 | // Water Height |
131 | m_regInfo.estateSettings.waterHeight = WaterHeight; | 131 | m_regInfo.estateSettings.waterHeight = WaterHeight; |
@@ -144,13 +144,12 @@ namespace OpenSim.Region.Environment | |||
144 | 144 | ||
145 | #region Packet Handlers | 145 | #region Packet Handlers |
146 | 146 | ||
147 | |||
148 | public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client) | 147 | public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client) |
149 | { | 148 | { |
150 | switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) | 149 | switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) |
151 | { | 150 | { |
152 | case "getinfo": | 151 | case "getinfo": |
153 | this.sendRegionInfoPacketToAll(); | 152 | sendRegionInfoPacketToAll(); |
154 | break; | 153 | break; |
155 | case "setregioninfo": | 154 | case "setregioninfo": |
156 | if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) | 155 | if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) |
@@ -193,47 +192,54 @@ namespace OpenSim.Region.Environment | |||
193 | 192 | ||
194 | if (convertParamStringToBool(packet.ParamList[0].Parameter)) | 193 | if (convertParamStringToBool(packet.ParamList[0].Parameter)) |
195 | { | 194 | { |
196 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.BlockTerraform; | 195 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
196 | Simulator.RegionFlags.BlockTerraform; | ||
197 | } | 197 | } |
198 | 198 | ||
199 | if (convertParamStringToBool(packet.ParamList[1].Parameter)) | 199 | if (convertParamStringToBool(packet.ParamList[1].Parameter)) |
200 | { | 200 | { |
201 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.NoFly; | 201 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
202 | Simulator.RegionFlags.NoFly; | ||
202 | } | 203 | } |
203 | 204 | ||
204 | if (convertParamStringToBool(packet.ParamList[2].Parameter)) | 205 | if (convertParamStringToBool(packet.ParamList[2].Parameter)) |
205 | { | 206 | { |
206 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.AllowDamage; | 207 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
208 | Simulator.RegionFlags.AllowDamage; | ||
207 | } | 209 | } |
208 | 210 | ||
209 | if (convertParamStringToBool(packet.ParamList[3].Parameter) == false) | 211 | if (convertParamStringToBool(packet.ParamList[3].Parameter) == false) |
210 | { | 212 | { |
211 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.BlockLandResell; | 213 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
214 | Simulator.RegionFlags.BlockLandResell; | ||
212 | } | 215 | } |
213 | 216 | ||
214 | 217 | ||
215 | int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter))); | 218 | int tempMaxAgents = |
216 | m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents; | 219 | Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter))); |
220 | m_regInfo.estateSettings.maxAgents = (byte) tempMaxAgents; | ||
217 | 221 | ||
218 | float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); | 222 | float tempObjectBonusFactor = |
223 | (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); | ||
219 | m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor; | 224 | m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor; |
220 | 225 | ||
221 | int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter)); | 226 | int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter)); |
222 | m_regInfo.estateSettings.simAccess = (Simulator.SimAccess)tempMatureLevel; | 227 | m_regInfo.estateSettings.simAccess = (Simulator.SimAccess) tempMatureLevel; |
223 | 228 | ||
224 | 229 | ||
225 | if (convertParamStringToBool(packet.ParamList[7].Parameter)) | 230 | if (convertParamStringToBool(packet.ParamList[7].Parameter)) |
226 | { | 231 | { |
227 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.RestrictPushObject; | 232 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
233 | Simulator.RegionFlags.RestrictPushObject; | ||
228 | } | 234 | } |
229 | 235 | ||
230 | if (convertParamStringToBool(packet.ParamList[8].Parameter)) | 236 | if (convertParamStringToBool(packet.ParamList[8].Parameter)) |
231 | { | 237 | { |
232 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.AllowParcelChanges; | 238 | m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | |
239 | Simulator.RegionFlags.AllowParcelChanges; | ||
233 | } | 240 | } |
234 | 241 | ||
235 | sendRegionInfoPacketToAll(); | 242 | sendRegionInfoPacketToAll(); |
236 | |||
237 | } | 243 | } |
238 | } | 244 | } |
239 | 245 | ||
@@ -245,11 +251,13 @@ namespace OpenSim.Region.Environment | |||
245 | } | 251 | } |
246 | else | 252 | else |
247 | { | 253 | { |
248 | float WaterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter)); | 254 | float WaterHeight = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter)); |
249 | float TerrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter)); | 255 | float TerrainRaiseLimit = |
250 | float TerrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)); | 256 | (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter)); |
251 | bool UseFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter); | 257 | float TerrainLowerLimit = |
252 | float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); | 258 | (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)); |
259 | bool UseFixedSun = convertParamStringToBool(packet.ParamList[4].Parameter); | ||
260 | float SunHour = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); | ||
253 | 261 | ||
254 | setRegionSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour); | 262 | setRegionSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour); |
255 | 263 | ||
@@ -265,10 +273,9 @@ namespace OpenSim.Region.Environment | |||
265 | string[] splitField = s.Split(' '); | 273 | string[] splitField = s.Split(' '); |
266 | if (splitField.Length == 3) | 274 | if (splitField.Length == 3) |
267 | { | 275 | { |
268 | |||
269 | Int16 corner = Convert.ToInt16(splitField[0]); | 276 | Int16 corner = Convert.ToInt16(splitField[0]); |
270 | float lowValue = (float)Convert.ToDecimal(splitField[1]); | 277 | float lowValue = (float) Convert.ToDecimal(splitField[1]); |
271 | float highValue = (float)Convert.ToDecimal(splitField[2]); | 278 | float highValue = (float) Convert.ToDecimal(splitField[2]); |
272 | 279 | ||
273 | setEstateTextureRange(corner, lowValue, highValue); | 280 | setEstateTextureRange(corner, lowValue, highValue); |
274 | } | 281 | } |
@@ -279,7 +286,6 @@ namespace OpenSim.Region.Environment | |||
279 | { | 286 | { |
280 | foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) | 287 | foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) |
281 | { | 288 | { |
282 | |||
283 | string s = Helpers.FieldToUTF8String(block.Parameter); | 289 | string s = Helpers.FieldToUTF8String(block.Parameter); |
284 | string[] splitField = s.Split(' '); | 290 | string[] splitField = s.Split(' '); |
285 | if (splitField.Length == 2) | 291 | if (splitField.Length == 2) |
@@ -326,12 +332,12 @@ namespace OpenSim.Region.Environment | |||
326 | 332 | ||
327 | public void sendRegionInfoPacketToAll() | 333 | public void sendRegionInfoPacketToAll() |
328 | { | 334 | { |
329 | List<Avatar> avatars = m_scene.RequestAvatarList(); | 335 | List<Avatar> avatars = m_scene.RequestAvatarList(); |
330 | 336 | ||
331 | for (int i = 0; i < avatars.Count; i++) | 337 | for (int i = 0; i < avatars.Count; i++) |
332 | { | 338 | { |
333 | this.sendRegionInfoPacket(avatars[i].ControllingClient); | 339 | sendRegionInfoPacket(avatars[i].ControllingClient); |
334 | } | 340 | } |
335 | } | 341 | } |
336 | 342 | ||
337 | public void sendRegionHandshakeToAll() | 343 | public void sendRegionHandshakeToAll() |
@@ -340,8 +346,8 @@ namespace OpenSim.Region.Environment | |||
340 | 346 | ||
341 | for (int i = 0; i < avatars.Count; i++) | 347 | for (int i = 0; i < avatars.Count; i++) |
342 | { | 348 | { |
343 | this.sendRegionHandshake(avatars[i].ControllingClient); | 349 | sendRegionHandshake(avatars[i].ControllingClient); |
344 | } | 350 | } |
345 | } | 351 | } |
346 | 352 | ||
347 | public void sendRegionInfoPacket(IClientAPI remote_client) | 353 | public void sendRegionInfoPacket(IClientAPI remote_client) |
@@ -361,9 +367,9 @@ namespace OpenSim.Region.Environment | |||
361 | regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.estateSettings.pricePerMeter; | 367 | regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.estateSettings.pricePerMeter; |
362 | regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.estateSettings.redirectGridX; | 368 | regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.estateSettings.redirectGridX; |
363 | regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.estateSettings.redirectGridY; | 369 | regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.estateSettings.redirectGridY; |
364 | regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags; | 370 | regionInfoPacket.RegionInfo.RegionFlags = (uint) m_regInfo.estateSettings.regionFlags; |
365 | regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess; | 371 | regionInfoPacket.RegionInfo.SimAccess = (byte) m_regInfo.estateSettings.simAccess; |
366 | regionInfoPacket.RegionInfo.SimName = _enc.GetBytes( m_regInfo.RegionName); | 372 | regionInfoPacket.RegionInfo.SimName = _enc.GetBytes(m_regInfo.RegionName); |
367 | regionInfoPacket.RegionInfo.SunHour = m_regInfo.estateSettings.sunHour; | 373 | regionInfoPacket.RegionInfo.SunHour = m_regInfo.estateSettings.sunHour; |
368 | regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.estateSettings.terrainLowerLimit; | 374 | regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.estateSettings.terrainLowerLimit; |
369 | regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.estateSettings.terrainRaiseLimit; | 375 | regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.estateSettings.terrainRaiseLimit; |
@@ -379,6 +385,5 @@ namespace OpenSim.Region.Environment | |||
379 | } | 385 | } |
380 | 386 | ||
381 | #endregion | 387 | #endregion |
382 | |||
383 | } | 388 | } |
384 | } | 389 | } \ No newline at end of file |