diff options
author | MW | 2007-11-30 15:10:47 +0000 |
---|---|---|
committer | MW | 2007-11-30 15:10:47 +0000 |
commit | 0b2934a1b1e34b7f7a33720a1f6a7852b0d1a6fe (patch) | |
tree | 2abce027351e7f0f501d18d83d67675ad7348a3c /OpenSim/Region/Application | |
parent | small change to OnSceneGroupMove event (in SceneEvents.cs) (diff) | |
download | opensim-SC_OLD-0b2934a1b1e34b7f7a33720a1f6a7852b0d1a6fe.zip opensim-SC_OLD-0b2934a1b1e34b7f7a33720a1f6a7852b0d1a6fe.tar.gz opensim-SC_OLD-0b2934a1b1e34b7f7a33720a1f6a7852b0d1a6fe.tar.bz2 opensim-SC_OLD-0b2934a1b1e34b7f7a33720a1f6a7852b0d1a6fe.tar.xz |
added support for a console command script to be ran every 20 minutes (will make that time changable in a future commit), to use add a entry under the Startup section of opensim.ini , with: timer_Script = "<filename>" (the filename being the console "script" you want to be ran every 20 minutes). This hasn't been tested very much so..
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 4ebe207..51a647d 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -86,6 +86,9 @@ namespace OpenSim | |||
86 | 86 | ||
87 | private string m_assetStorage = "sqlite"; | 87 | private string m_assetStorage = "sqlite"; |
88 | 88 | ||
89 | private string m_timedScript = "disabled"; | ||
90 | private System.Timers.Timer m_scriptTimer; | ||
91 | |||
89 | public ConsoleCommand CreateAccount = null; | 92 | public ConsoleCommand CreateAccount = null; |
90 | private bool m_dumpAssetsToFile; | 93 | private bool m_dumpAssetsToFile; |
91 | 94 | ||
@@ -236,6 +239,8 @@ namespace OpenSim | |||
236 | m_scriptEngine = startupConfig.GetString("script_engine", "DotNetEngine"); | 239 | m_scriptEngine = startupConfig.GetString("script_engine", "DotNetEngine"); |
237 | 240 | ||
238 | m_assetStorage = startupConfig.GetString("asset_database", "sqlite"); | 241 | m_assetStorage = startupConfig.GetString("asset_database", "sqlite"); |
242 | |||
243 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | ||
239 | } | 244 | } |
240 | 245 | ||
241 | IConfig standaloneConfig = m_config.Configs["StandAlone"]; | 246 | IConfig standaloneConfig = m_config.Configs["StandAlone"]; |
@@ -339,6 +344,14 @@ namespace OpenSim | |||
339 | 344 | ||
340 | MainLog.Instance.Status("STARTUP", | 345 | MainLog.Instance.Status("STARTUP", |
341 | "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); | 346 | "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); |
347 | |||
348 | if (m_timedScript != "disabled") | ||
349 | { | ||
350 | m_scriptTimer = new System.Timers.Timer(); | ||
351 | m_scriptTimer.Enabled = true; | ||
352 | m_scriptTimer.Interval = (int)(1200 * 1000); | ||
353 | m_scriptTimer.Elapsed += new System.Timers.ElapsedEventHandler(RunAutoTimerScript); | ||
354 | } | ||
342 | } | 355 | } |
343 | 356 | ||
344 | public UDPServer CreateRegion(RegionInfo regionInfo) | 357 | public UDPServer CreateRegion(RegionInfo regionInfo) |
@@ -523,6 +536,13 @@ namespace OpenSim | |||
523 | Environment.Exit(0); | 536 | Environment.Exit(0); |
524 | } | 537 | } |
525 | 538 | ||
539 | private void RunAutoTimerScript(object sender, EventArgs e) | ||
540 | { | ||
541 | if (m_timedScript != "disabled") | ||
542 | { | ||
543 | RunCommandScript(m_timedScript); | ||
544 | } | ||
545 | } | ||
526 | #region Console Commands | 546 | #region Console Commands |
527 | 547 | ||
528 | /// <summary> | 548 | /// <summary> |