From b9d61d5413e7189ddc6f7a335f792abf870a92c8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 29 Mar 2012 15:38:12 +0200 Subject: Allow the map tile module to be enabled without also eabling refresh --- .../MapImage/MapImageServiceModule.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 6d3ace9..3b862da 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs @@ -93,8 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage if (config == null) return; - int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); - if (refreshminutes <= 0) + int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1")); + if (refreshminutes < 0) { m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled."); return; @@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage return; } - m_refreshTimer.Enabled = true; - m_refreshTimer.AutoReset = true; - m_refreshTimer.Interval = m_refreshtime; - m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); + if (m_refreshtime > 0) + { + m_refreshTimer.Enabled = true; + m_refreshTimer.AutoReset = true; + m_refreshTimer.Interval = m_refreshtime; + m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); + } - m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0}min and service object {1}", + m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", refreshminutes, service); m_enabled = true; @@ -238,4 +241,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage } } } -} \ No newline at end of file +} -- cgit v1.1