aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorAdam Frisby2008-05-04 19:30:26 +0000
committerAdam Frisby2008-05-04 19:30:26 +0000
commit9752669011a9a63b3f74923fa3f4dfa18ef23eed (patch)
treee62ed9d7bf3e7ff4a812601bf9b50952308bdb77 /OpenSim/Region/Environment
parent* Updating some file locations. (diff)
downloadopensim-SC_OLD-9752669011a9a63b3f74923fa3f4dfa18ef23eed.zip
opensim-SC_OLD-9752669011a9a63b3f74923fa3f4dfa18ef23eed.tar.gz
opensim-SC_OLD-9752669011a9a63b3f74923fa3f4dfa18ef23eed.tar.bz2
opensim-SC_OLD-9752669011a9a63b3f74923fa3f4dfa18ef23eed.tar.xz
* Reformatted EstateManagementModule
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs109
1 files changed, 48 insertions, 61 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index e15602a..3e466dc 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -25,16 +25,14 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
29using System.Collections.Generic; 28using System.Collections.Generic;
30using System.Reflection; 29using System.Reflection;
31
32using libsecondlife; 30using libsecondlife;
31using log4net;
32using Nini.Config;
33using OpenSim.Framework;
33using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
34using OpenSim.Region.Environment.Scenes; 35using OpenSim.Region.Environment.Scenes;
35using OpenSim.Framework;
36using Nini.Config;
37using log4net;
38 36
39namespace OpenSim.Region.Environment.Modules.World.Estate 37namespace OpenSim.Region.Environment.Modules.World.Estate
40{ 38{
@@ -44,68 +42,63 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
44 42
45 private Scene m_scene; 43 private Scene m_scene;
46 44
47
48
49
50 #region Packet Data Responders 45 #region Packet Data Responders
51 private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
52 {
53 46
47 private static void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
48 {
54 remote_client.sendDetailedEstateData(invoice); 49 remote_client.sendDetailedEstateData(invoice);
55 remote_client.sendEstateManagersList(invoice); 50 remote_client.sendEstateManagersList(invoice);
56
57 } 51 }
58 52
59 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges) 53 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
54 int matureLevel, bool restrictPushObject, bool allowParcelChanges)
60 { 55 {
61
62 m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None; 56 m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None;
63 57
64 if (blockTerraform) 58 if (blockTerraform)
65 { 59 {
66 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 60 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
67 Simulator.RegionFlags.BlockTerraform; 61 Simulator.RegionFlags.BlockTerraform;
68 } 62 }
69 63
70 if (noFly) 64 if (noFly)
71 { 65 {
72 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 66 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
73 Simulator.RegionFlags.NoFly; 67 Simulator.RegionFlags.NoFly;
74 } 68 }
75 69
76 if (allowDamage) 70 if (allowDamage)
77 { 71 {
78 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 72 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
79 Simulator.RegionFlags.AllowDamage; 73 Simulator.RegionFlags.AllowDamage;
80 } 74 }
81 75
82 if (blockLandResell) 76 if (blockLandResell)
83 { 77 {
84 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 78 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
85 Simulator.RegionFlags.BlockLandResell; 79 Simulator.RegionFlags.BlockLandResell;
86 } 80 }
87 81
88 m_scene.RegionInfo.EstateSettings.maxAgents = (byte)maxAgents; 82 m_scene.RegionInfo.EstateSettings.maxAgents = (byte) maxAgents;
89 83
90 m_scene.RegionInfo.EstateSettings.objectBonusFactor = objectBonusFactor; 84 m_scene.RegionInfo.EstateSettings.objectBonusFactor = objectBonusFactor;
91 85
92 m_scene.RegionInfo.EstateSettings.simAccess = (Simulator.SimAccess)matureLevel; 86 m_scene.RegionInfo.EstateSettings.simAccess = (Simulator.SimAccess) matureLevel;
93 87
94 88
95 if (restrictPushObject) 89 if (restrictPushObject)
96 { 90 {
97 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 91 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
98 Simulator.RegionFlags.RestrictPushObject; 92 Simulator.RegionFlags.RestrictPushObject;
99 } 93 }
100 94
101 if (allowParcelChanges) 95 if (allowParcelChanges)
102 { 96 {
103 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags | 97 m_scene.RegionInfo.EstateSettings.regionFlags = m_scene.RegionInfo.EstateSettings.regionFlags |
104 Simulator.RegionFlags.AllowParcelChanges; 98 Simulator.RegionFlags.AllowParcelChanges;
105 } 99 }
106 100
107 sendRegionInfoPacketToAll(); 101 sendRegionInfoPacketToAll();
108
109 } 102 }
110 103
111 public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, LLUUID texture) 104 public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, LLUUID texture)
@@ -175,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
175 } 168 }
176 169
177 public void setRegionTerrainSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, 170 public void setRegionTerrainSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit,
178 bool UseFixedSun, float SunHour) 171 bool UseFixedSun, float SunHour)
179 { 172 {
180 // Water Height 173 // Water Height
181 m_scene.RegionInfo.EstateSettings.waterHeight = WaterHeight; 174 m_scene.RegionInfo.EstateSettings.waterHeight = WaterHeight;
@@ -198,10 +191,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
198 191
199 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID) 192 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID)
200 { 193 {
201
202 m_scene.RegionInfo.CovenantID = estateCovenantID; 194 m_scene.RegionInfo.CovenantID = estateCovenantID;
203 m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID); 195 m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID);
204
205 } 196 }
206 197
207 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user) 198 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user)
@@ -247,10 +238,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
247 } 238 }
248 239
249 private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) 240 private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message)
250 { 241 {
251 m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message); 242 m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message);
252
253 } 243 }
244
254 private void SendEstateBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) 245 private void SendEstateBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message)
255 { 246 {
256 m_scene.SendEstateMessageFromEstateTools(senderID, sessionID, senderName, message); 247 m_scene.SendEstateMessageFromEstateTools(senderID, sessionID, senderName, message);
@@ -258,8 +249,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
258 249
259 private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics) 250 private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics)
260 { 251 {
261
262
263 if (physics) 252 if (physics)
264 { 253 {
265 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics; 254 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics;
@@ -284,7 +273,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
284 273
285 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, LLUUID invoice, LLUUID senderID, LLUUID prey) 274 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, LLUUID invoice, LLUUID senderID, LLUUID prey)
286 { 275 {
287
288 if (prey != LLUUID.Zero) 276 if (prey != LLUUID.Zero)
289 { 277 {
290 ScenePresence s = m_scene.GetScenePresence(prey); 278 ScenePresence s = m_scene.GetScenePresence(prey);
@@ -295,19 +283,17 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
295 } 283 }
296 } 284 }
297 285
298 private void HandleRegionInfoRequest(IClientAPI remote_client) 286 private static void HandleRegionInfoRequest(IClientAPI remote_client)
299 { 287 {
300 remote_client.sendRegionInfoToEstateMenu(); 288 remote_client.sendRegionInfoToEstateMenu();
301 } 289 }
302 290
303 private void HandleEstateCovenantRequest(IClientAPI remote_client) 291 private static void HandleEstateCovenantRequest(IClientAPI remote_client)
304 { 292 {
305 remote_client.sendEstateCovenantInformation(); 293 remote_client.sendEstateCovenantInformation();
306 } 294 }
307 295
308 296 #endregion
309#endregion
310
311 297
312 #region Outgoing Packets 298 #region Outgoing Packets
313 299
@@ -320,6 +306,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
320 avatars[i].ControllingClient.sendRegionInfoToEstateMenu(); 306 avatars[i].ControllingClient.sendRegionInfoToEstateMenu();
321 } 307 }
322 } 308 }
309
323 public void sendRegionHandshake(IClientAPI remoteClient) 310 public void sendRegionHandshake(IClientAPI remoteClient)
324 { 311 {
325 remoteClient.SendRegionHandshake(m_scene.RegionInfo); 312 remoteClient.SendRegionHandshake(m_scene.RegionInfo);
@@ -339,31 +326,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
339 public void Initialise(Scene scene, IConfigSource source) 326 public void Initialise(Scene scene, IConfigSource source)
340 { 327 {
341 m_scene = scene; 328 m_scene = scene;
342 m_scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); 329 m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
343 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; 330 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
344
345 }
346
347 void EventManager_OnNewClient(IClientAPI client)
348 {
349 client.OnDetailedEstateDataRequest += sendDetailedEstateData;
350 client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
351 client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
352 client.OnSetEstateTerrainDetailTexture += setEstateTerrainDetailTexture;
353 client.OnSetEstateTerrainTextureHeights += setEstateTerrainTextureHeights;
354 client.OnCommitEstateTerrainTextureRequest += handleCommitEstateTerrainTextureRequest;
355 client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
356 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
357 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
358 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
359 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
360 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
361 client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest;
362 client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest;
363
364 client.OnRegionInfoRequest += HandleRegionInfoRequest;
365 client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
366 sendRegionHandshake(client);
367 } 331 }
368 332
369 333
@@ -391,10 +355,33 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
391 355
392 public void changeWaterHeight(float height) 356 public void changeWaterHeight(float height)
393 { 357 {
394 setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit, m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour); 358 setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit,
359 m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour);
395 sendRegionInfoPacketToAll(); 360 sendRegionInfoPacketToAll();
396 } 361 }
362
397 #endregion 363 #endregion
398 364
365 private void EventManager_OnNewClient(IClientAPI client)
366 {
367 client.OnDetailedEstateDataRequest += sendDetailedEstateData;
368 client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
369 client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
370 client.OnSetEstateTerrainDetailTexture += setEstateTerrainDetailTexture;
371 client.OnSetEstateTerrainTextureHeights += setEstateTerrainTextureHeights;
372 client.OnCommitEstateTerrainTextureRequest += handleCommitEstateTerrainTextureRequest;
373 client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
374 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
375 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
376 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
377 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
378 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
379 client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest;
380 client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest;
381
382 client.OnRegionInfoRequest += HandleRegionInfoRequest;
383 client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
384 sendRegionHandshake(client);
385 }
399 } 386 }
400} 387} \ No newline at end of file