aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-23 03:56:53 +0000
committerJustin Clark-Casey (justincc)2012-11-23 03:56:53 +0000
commitf473252fa8022f95f60e219b24ffa342966f8c13 (patch)
treef5684cec761050fa0a01a51918ead09eda9eaf82 /OpenSim/Region
parentRemove the redundant BypassPermissions() checks in EstateManagmentModule. (diff)
downloadopensim-SC_OLD-f473252fa8022f95f60e219b24ffa342966f8c13.zip
opensim-SC_OLD-f473252fa8022f95f60e219b24ffa342966f8c13.tar.gz
opensim-SC_OLD-f473252fa8022f95f60e219b24ffa342966f8c13.tar.bz2
opensim-SC_OLD-f473252fa8022f95f60e219b24ffa342966f8c13.tar.xz
Add AllowRegionRestartFromClient setting to [EstateManagement] section of OpenSim.ini.
Setting this to false will block all restart requests from the viewer even if they are otherwise legitimate. One use is to block region restarts if necessary whilst restart functionality remains buggy or triggers bugs in modules, though these should be fixed as soon as practicable. Default is true, as has been the case historically.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs103
1 files changed, 63 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index f974a63..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 {
@@ -329,6 +389,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
329 } 389 }
330 390
331 } 391 }
392
332 if ((estateAccessType & 8) != 0) // User remove 393 if ((estateAccessType & 8) != 0) // User remove
333 { 394 {
334 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true)) 395 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
@@ -360,6 +421,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
360 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); 421 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
361 } 422 }
362 } 423 }
424
363 if ((estateAccessType & 16) != 0) // Group add 425 if ((estateAccessType & 16) != 0) // Group add
364 { 426 {
365 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true)) 427 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true))
@@ -623,7 +685,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
623 } 685 }
624 } 686 }
625 687
626 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)
627 { 689 {
628 SceneObjectPart part; 690 SceneObjectPart part;
629 691
@@ -1081,45 +1143,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
1081 1143
1082 #endregion 1144 #endregion
1083 1145
1084 #region Region Module interface
1085
1086 public string Name { get { return "EstateManagementModule"; } }
1087
1088 public Type ReplaceableInterface { get { return null; } }
1089
1090 public void Initialise(IConfigSource source) {}
1091
1092 public void AddRegion(Scene scene)
1093 {
1094 Scene = scene;
1095 Scene.RegisterModuleInterface<IEstateModule>(this);
1096 Scene.EventManager.OnNewClient += EventManager_OnNewClient;
1097 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
1098
1099 m_Telehub = new TelehubManager(scene);
1100
1101 m_commands = new EstateManagementCommands(this);
1102 m_commands.Initialise();
1103 }
1104
1105 public void RemoveRegion(Scene scene) {}
1106
1107 public void RegionLoaded(Scene scene)
1108 {
1109 // Sets up the sun module based no the saved Estate and Region Settings
1110 // DO NOT REMOVE or the sun will stop working
1111 scene.TriggerEstateSunUpdate();
1112
1113 UserManager = scene.RequestModuleInterface<IUserManagement>();
1114 }
1115
1116 public void Close()
1117 {
1118 m_commands.Close();
1119 }
1120
1121 #endregion
1122
1123 #region Other Functions 1146 #region Other Functions
1124 1147
1125 public void changeWaterHeight(float height) 1148 public void changeWaterHeight(float height)