aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie2010-11-25 03:27:35 +0000
committerMelanie2010-11-25 03:27:35 +0000
commit6c3eb21440a323b8669326767cfc55beda2ff35c (patch)
tree84de5d5908ee2b5858a380e96b79188629267cd1 /OpenSim/Region/ScriptEngine
parentFinish the RestartModule and fix some bugs. Add new console commands: (diff)
parentChange all restarting to use the restart module. Remove hardcoded behavior (diff)
downloadopensim-SC_OLD-6c3eb21440a323b8669326767cfc55beda2ff35c.zip
opensim-SC_OLD-6c3eb21440a323b8669326767cfc55beda2ff35c.tar.gz
opensim-SC_OLD-6c3eb21440a323b8669326767cfc55beda2ff35c.tar.bz2
opensim-SC_OLD-6c3eb21440a323b8669326767cfc55beda2ff35c.tar.xz
Merge branch 'master' into careminster-presence-refactor
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 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}