aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs128
1 files changed, 80 insertions, 48 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 0e6d663..eb06fcc 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -53,6 +53,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
53 53
54 protected EstateManagementCommands m_commands; 54 protected EstateManagementCommands m_commands;
55 55
56 /// <summary>
57 /// If false, region restart requests from the client are blocked even if they are otherwise legitimate.
58 /// </summary>
59 public bool AllowRegionRestartFromClient { get; set; }
60
56 private EstateTerrainXferHandler TerrainUploader; 61 private EstateTerrainXferHandler TerrainUploader;
57 public TelehubManager m_Telehub; 62 public TelehubManager m_Telehub;
58 63
@@ -60,6 +65,53 @@ namespace OpenSim.Region.CoreModules.World.Estate
60 public event ChangeDelegate OnEstateInfoChange; 65 public event ChangeDelegate OnEstateInfoChange;
61 public event MessageDelegate OnEstateMessage; 66 public event MessageDelegate OnEstateMessage;
62 67
68 #region Region Module interface
69
70 public string Name { get { return "EstateManagementModule"; } }
71
72 public Type ReplaceableInterface { get { return null; } }
73
74 public void Initialise(IConfigSource source)
75 {
76 AllowRegionRestartFromClient = true;
77
78 IConfig config = source.Configs["EstateManagement"];
79
80 if (config != null)
81 AllowRegionRestartFromClient = config.GetBoolean("AllowRegionRestartFromClient", true);
82 }
83
84 public void AddRegion(Scene scene)
85 {
86 Scene = scene;
87 Scene.RegisterModuleInterface<IEstateModule>(this);
88 Scene.EventManager.OnNewClient += EventManager_OnNewClient;
89 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
90
91 m_Telehub = new TelehubManager(scene);
92
93 m_commands = new EstateManagementCommands(this);
94 m_commands.Initialise();
95 }
96
97 public void RemoveRegion(Scene scene) {}
98
99 public void RegionLoaded(Scene scene)
100 {
101 // Sets up the sun module based no the saved Estate and Region Settings
102 // DO NOT REMOVE or the sun will stop working
103 scene.TriggerEstateSunUpdate();
104
105 UserManager = scene.RequestModuleInterface<IUserManagement>();
106 }
107
108 public void Close()
109 {
110 m_commands.Close();
111 }
112
113 #endregion
114
63 #region Packet Data Responders 115 #region Packet Data Responders
64 116
65 private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) 117 private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
@@ -184,6 +236,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
184 Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; 236 Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
185 break; 237 break;
186 } 238 }
239
187 Scene.RegionInfo.RegionSettings.Save(); 240 Scene.RegionInfo.RegionSettings.Save();
188 TriggerRegionInfoChange(); 241 TriggerRegionInfoChange();
189 sendRegionInfoPacketToAll(); 242 sendRegionInfoPacketToAll();
@@ -215,6 +268,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
215 Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; 268 Scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
216 break; 269 break;
217 } 270 }
271
218 Scene.RegionInfo.RegionSettings.Save(); 272 Scene.RegionInfo.RegionSettings.Save();
219 TriggerRegionInfoChange(); 273 TriggerRegionInfoChange();
220 sendRegionHandshakeToAll(); 274 sendRegionHandshakeToAll();
@@ -255,6 +309,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
255 309
256 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) 310 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
257 { 311 {
312 if (!AllowRegionRestartFromClient)
313 {
314 remoteClient.SendAlertMessage("Region restart has been disabled on this simulator.");
315 return;
316 }
317
258 IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>(); 318 IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>();
259 if (restartModule != null) 319 if (restartModule != null)
260 { 320 {
@@ -271,6 +331,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
271 } 331 }
272 332
273 restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); 333 restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true);
334
335 m_log.InfoFormat(
336 "User {0} requested restart of region {1} in {2} seconds",
337 remoteClient.Name, Scene.Name, times.Count != 0 ? times[0] : 0);
274 } 338 }
275 } 339 }
276 340
@@ -295,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
295 359
296 if ((estateAccessType & 4) != 0) // User add 360 if ((estateAccessType & 4) != 0) // User add
297 { 361 {
298 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 362 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
299 { 363 {
300 if ((estateAccessType & 1) != 0) // All estates 364 if ((estateAccessType & 1) != 0) // All estates
301 { 365 {
@@ -325,9 +389,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
325 } 389 }
326 390
327 } 391 }
392
328 if ((estateAccessType & 8) != 0) // User remove 393 if ((estateAccessType & 8) != 0) // User remove
329 { 394 {
330 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 395 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
331 { 396 {
332 if ((estateAccessType & 1) != 0) // All estates 397 if ((estateAccessType & 1) != 0) // All estates
333 { 398 {
@@ -356,9 +421,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
356 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 421 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
357 } 422 }
358 } 423 }
424
359 if ((estateAccessType & 16) != 0) // Group add 425 if ((estateAccessType & 16) != 0) // Group add
360 { 426 {
361 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 427 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
362 { 428 {
363 if ((estateAccessType & 1) != 0) // All estates 429 if ((estateAccessType & 1) != 0) // All estates
364 { 430 {
@@ -387,9 +453,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
387 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 453 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
388 } 454 }
389 } 455 }
456
390 if ((estateAccessType & 32) != 0) // Group remove 457 if ((estateAccessType & 32) != 0) // Group remove
391 { 458 {
392 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 459 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
393 { 460 {
394 if ((estateAccessType & 1) != 0) // All estates 461 if ((estateAccessType & 1) != 0) // All estates
395 { 462 {
@@ -418,9 +485,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
418 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 485 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
419 } 486 }
420 } 487 }
488
421 if ((estateAccessType & 64) != 0) // Ban add 489 if ((estateAccessType & 64) != 0) // Ban add
422 { 490 {
423 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions()) 491 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false))
424 { 492 {
425 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans; 493 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans;
426 494
@@ -495,9 +563,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
495 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 563 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
496 } 564 }
497 } 565 }
566
498 if ((estateAccessType & 128) != 0) // Ban remove 567 if ((estateAccessType & 128) != 0) // Ban remove
499 { 568 {
500 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions()) 569 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false))
501 { 570 {
502 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans; 571 EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans;
503 572
@@ -550,9 +619,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
550 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 619 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
551 } 620 }
552 } 621 }
622
553 if ((estateAccessType & 256) != 0) // Manager add 623 if ((estateAccessType & 256) != 0) // Manager add
554 { 624 {
555 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 625 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
556 { 626 {
557 if ((estateAccessType & 1) != 0) // All estates 627 if ((estateAccessType & 1) != 0) // All estates
558 { 628 {
@@ -581,9 +651,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
581 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 651 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
582 } 652 }
583 } 653 }
654
584 if ((estateAccessType & 512) != 0) // Manager remove 655 if ((estateAccessType & 512) != 0) // Manager remove
585 { 656 {
586 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 657 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
587 { 658 {
588 if ((estateAccessType & 1) != 0) // All estates 659 if ((estateAccessType & 1) != 0) // All estates
589 { 660 {
@@ -614,7 +685,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
614 } 685 }
615 } 686 }
616 687
617 public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1) 688 public void handleOnEstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
618 { 689 {
619 SceneObjectPart part; 690 SceneObjectPart part;
620 691
@@ -1072,45 +1143,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
1072 1143
1073 #endregion 1144 #endregion
1074 1145
1075 #region IRegionModule Members
1076
1077 public string Name { get { return "EstateManagementModule"; } }
1078
1079 public Type ReplaceableInterface { get { return null; } }
1080
1081 public void Initialise(IConfigSource source) {}
1082
1083 public void AddRegion(Scene scene)
1084 {
1085 Scene = scene;
1086 Scene.RegisterModuleInterface<IEstateModule>(this);
1087 Scene.EventManager.OnNewClient += EventManager_OnNewClient;
1088 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
1089
1090 m_Telehub = new TelehubManager(scene);
1091
1092 m_commands = new EstateManagementCommands(this);
1093 m_commands.Initialise();
1094 }
1095
1096 public void RemoveRegion(Scene scene) {}
1097
1098 public void RegionLoaded(Scene scene)
1099 {
1100 // Sets up the sun module based no the saved Estate and Region Settings
1101 // DO NOT REMOVE or the sun will stop working
1102 scene.TriggerEstateSunUpdate();
1103
1104 UserManager = scene.RequestModuleInterface<IUserManagement>();
1105 }
1106
1107 public void Close()
1108 {
1109 m_commands.Close();
1110 }
1111
1112 #endregion
1113
1114 #region Other Functions 1146 #region Other Functions
1115 1147
1116 public void changeWaterHeight(float height) 1148 public void changeWaterHeight(float height)