aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index fc92f23..827626f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -395,10 +395,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
395 // 395 //
396 CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); 396 CheckThreatLevel(ThreatLevel.High, "osRegionRestart");
397 397
398 IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>();
398 m_host.AddScriptLPS(1); 399 m_host.AddScriptLPS(1);
399 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false)) 400 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null))
400 { 401 {
401 World.Restart((float)seconds); 402 if (seconds < 15)
403 {
404 restartModule.AbortRestart("Restart aborted");
405 return 1;
406 }
407
408 List<int> times = new List<int>();
409 while (seconds > 0)
410 {
411 times.Add((int)seconds);
412 if (seconds > 300)
413 seconds -= 120;
414 else if (seconds > 30)
415 seconds -= 30;
416 else
417 seconds -= 15;
418 }
419
420 restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true);
402 return 1; 421 return 1;
403 } 422 }
404 else 423 else
@@ -2315,4 +2334,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2315 return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); 2334 return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
2316 } 2335 }
2317 } 2336 }
2318} \ No newline at end of file 2337}