diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 25 |
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 26ef0dd..eba6e75 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -404,10 +404,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
404 | // | 404 | // |
405 | CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); | 405 | CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); |
406 | 406 | ||
407 | IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); | ||
407 | m_host.AddScriptLPS(1); | 408 | m_host.AddScriptLPS(1); |
408 | if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false)) | 409 | if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) |
409 | { | 410 | { |
410 | World.Restart((float)seconds); | 411 | if (seconds < 15) |
412 | { | ||
413 | restartModule.AbortRestart("Restart aborted"); | ||
414 | return 1; | ||
415 | } | ||
416 | |||
417 | List<int> times = new List<int>(); | ||
418 | while (seconds > 0) | ||
419 | { | ||
420 | times.Add((int)seconds); | ||
421 | if (seconds > 300) | ||
422 | seconds -= 120; | ||
423 | else if (seconds > 30) | ||
424 | seconds -= 30; | ||
425 | else | ||
426 | seconds -= 15; | ||
427 | } | ||
428 | |||
429 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); | ||
411 | return 1; | 430 | return 1; |
412 | } | 431 | } |
413 | else | 432 | else |
@@ -2328,4 +2347,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2328 | return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); | 2347 | return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); |
2329 | } | 2348 | } |
2330 | } | 2349 | } |
2331 | } \ No newline at end of file | 2350 | } |