diff options
author | Melanie | 2010-11-25 03:16:52 +0000 |
---|---|---|
committer | Melanie | 2010-11-25 03:16:52 +0000 |
commit | 57c4def254b85997f5b8a4cd4e7d1db550947290 (patch) | |
tree | 89c9521d8e208820ff54a1505088792b1eabb1a6 /OpenSim/Region/ScriptEngine | |
parent | Finish the RestartModule and fix some bugs. Add new console commands: (diff) | |
download | opensim-SC_OLD-57c4def254b85997f5b8a4cd4e7d1db550947290.zip opensim-SC_OLD-57c4def254b85997f5b8a4cd4e7d1db550947290.tar.gz opensim-SC_OLD-57c4def254b85997f5b8a4cd4e7d1db550947290.tar.bz2 opensim-SC_OLD-57c4def254b85997f5b8a4cd4e7d1db550947290.tar.xz |
Change all restarting to use the restart module. Remove hardcoded behavior
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 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 | } |