aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorMelanie2012-01-28 22:19:10 +0100
committerMelanie2012-01-28 22:19:10 +0100
commit7c824f02b445579c0ef54a2212f851ae811a639d (patch)
treec8781c80bbd861b739940403e9f83efa0101522b /OpenSim/ApplicationPlugins
parentFix calculating land prim count type width issue (diff)
downloadopensim-SC_OLD-7c824f02b445579c0ef54a2212f851ae811a639d.zip
opensim-SC_OLD-7c824f02b445579c0ef54a2212f851ae811a639d.tar.gz
opensim-SC_OLD-7c824f02b445579c0ef54a2212f851ae811a639d.tar.bz2
opensim-SC_OLD-7c824f02b445579c0ef54a2212f851ae811a639d.tar.xz
Add the ability to abort a pending restart using the viewer UI or a
RemoteAdmin message
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index dcc88c4..914e4d6 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -263,6 +263,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
263 Scene rebootedScene = null; 263 Scene rebootedScene = null;
264 GetSceneFromRegionParams(requestData, responseData, out rebootedScene); 264 GetSceneFromRegionParams(requestData, responseData, out rebootedScene);
265 265
266 IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
267
266 responseData["success"] = false; 268 responseData["success"] = false;
267 responseData["accepted"] = true; 269 responseData["accepted"] = true;
268 responseData["rebooting"] = true; 270 responseData["rebooting"] = true;
@@ -273,6 +275,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController
273 if (requestData.ContainsKey("alerts")) 275 if (requestData.ContainsKey("alerts"))
274 { 276 {
275 string[] alertTimes = requestData["alerts"].ToString().Split( new char[] {','}); 277 string[] alertTimes = requestData["alerts"].ToString().Split( new char[] {','});
278 if (alertTimes.Length == 1 && Convert.ToInt32(alertTimes[0]) == -1)
279 {
280 if (restartModule != null)
281 {
282 message = "Restart has been cancelled";
283
284 if (requestData.ContainsKey("message"))
285 message = requestData["message"].ToString();
286
287 restartModule.AbortRestart(message);
288
289 responseData["success"] = true;
290 responseData["rebooting"] = false;
291
292 return;
293 }
294 }
276 foreach (string a in alertTimes) 295 foreach (string a in alertTimes)
277 times.Add(Convert.ToInt32(a)); 296 times.Add(Convert.ToInt32(a));
278 } 297 }
@@ -305,7 +324,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
305 notice = false; 324 notice = false;
306 } 325 }
307 326
308 IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
309 if (restartModule != null) 327 if (restartModule != null)
310 { 328 {
311 restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice); 329 restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice);