diff options
author | Melanie | 2013-09-01 22:49:31 +0100 |
---|---|---|
committer | Melanie | 2013-09-01 22:49:31 +0100 |
commit | 008c98a9748ba7deadb80c435ddd372002b6c844 (patch) | |
tree | 9458b87c1d28d741ee6c2384eb1028375cb703ab /OpenSim/Region/CoreModules/World | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Profiles: Clean up some log entries caused when visiting HG avatar is using l... (diff) | |
download | opensim-SC_OLD-008c98a9748ba7deadb80c435ddd372002b6c844.zip opensim-SC_OLD-008c98a9748ba7deadb80c435ddd372002b6c844.tar.gz opensim-SC_OLD-008c98a9748ba7deadb80c435ddd372002b6c844.tar.bz2 opensim-SC_OLD-008c98a9748ba7deadb80c435ddd372002b6c844.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/World/Region/RestartModule.cs
OpenSim/Region/Framework/Scenes/SceneGraph.cs
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Region/RestartModule.cs | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index 9c441ed..0c74b49 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs | |||
@@ -48,8 +48,8 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RestartModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RestartModule")] |
49 | public class RestartModule : INonSharedRegionModule, IRestartModule | 49 | public class RestartModule : INonSharedRegionModule, IRestartModule |
50 | { | 50 | { |
51 | // private static readonly ILog m_log = | 51 | private static readonly ILog m_log = |
52 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | protected Scene m_Scene; | 54 | protected Scene m_Scene; |
55 | protected Timer m_CountdownTimer = null; | 55 | protected Timer m_CountdownTimer = null; |
@@ -223,11 +223,25 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
223 | 223 | ||
224 | public void SetTimer(int intervalSeconds) | 224 | public void SetTimer(int intervalSeconds) |
225 | { | 225 | { |
226 | m_CountdownTimer = new Timer(); | 226 | if (intervalSeconds > 0) |
227 | m_CountdownTimer.AutoReset = false; | 227 | { |
228 | m_CountdownTimer.Interval = intervalSeconds * 1000; | 228 | m_CountdownTimer = new Timer(); |
229 | m_CountdownTimer.Elapsed += OnTimer; | 229 | m_CountdownTimer.AutoReset = false; |
230 | m_CountdownTimer.Start(); | 230 | m_CountdownTimer.Interval = intervalSeconds * 1000; |
231 | m_CountdownTimer.Elapsed += OnTimer; | ||
232 | m_CountdownTimer.Start(); | ||
233 | } | ||
234 | else if (m_CountdownTimer != null) | ||
235 | { | ||
236 | m_CountdownTimer.Stop(); | ||
237 | m_CountdownTimer = null; | ||
238 | } | ||
239 | else | ||
240 | { | ||
241 | m_log.WarnFormat( | ||
242 | "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval", | ||
243 | intervalSeconds, m_Scene.Name); | ||
244 | } | ||
231 | } | 245 | } |
232 | 246 | ||
233 | private void OnTimer(object source, ElapsedEventArgs e) | 247 | private void OnTimer(object source, ElapsedEventArgs e) |
@@ -332,4 +346,4 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
332 | } | 346 | } |
333 | } | 347 | } |
334 | } | 348 | } |
335 | } \ No newline at end of file | 349 | } |