Convert SimianMaptile refresh time from ms to seconds. Too many 0's

in the config file.
0.7.1-dev
Mic Bowman 2011-02-04 14:21:18 -08:00
parent cf24069227
commit 7a6e1fa4cf
1 changed files with 12 additions and 11 deletions

View File

@ -87,16 +87,17 @@ namespace OpenSim.Region.OptionalModules.Simian
if (String.IsNullOrEmpty(m_serverUrl)) if (String.IsNullOrEmpty(m_serverUrl))
return; return;
m_refreshtime = Convert.ToInt32(config.GetString("RefreshTime")); int refreshseconds = Convert.ToInt32(config.GetString("RefreshTime"));
if (m_refreshtime <= 0) if (refreshseconds <= 0)
return; return;
m_refreshtime = refreshseconds * 1000; // convert from seconds to ms
m_log.InfoFormat("[SIMIAN MAPTILE] enabled with refresh timeout {0} and URL {1}", m_log.InfoFormat("[SIMIAN MAPTILE] enabled with refresh timeout {0} and URL {1}",
m_refreshtime,m_serverUrl); m_refreshtime,m_serverUrl);
m_enabled = true; m_enabled = true;
} }
///<summary> ///<summary>
/// ///
///</summary> ///</summary>
@ -106,7 +107,7 @@ namespace OpenSim.Region.OptionalModules.Simian
{ {
m_refreshTimer.Enabled = true; m_refreshTimer.Enabled = true;
m_refreshTimer.AutoReset = true; m_refreshTimer.AutoReset = true;
m_refreshTimer.Interval = 5 * 60 * 1000; // every 5 minutes m_refreshTimer.Interval = 5 * 60 * 1000; // every 5 minutes
m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
} }
} }
@ -120,12 +121,12 @@ namespace OpenSim.Region.OptionalModules.Simian
if (! m_enabled) if (! m_enabled)
return; return;
// Every shared region module has to maintain an indepedent list of // Every shared region module has to maintain an indepedent list of
// currently running regions // currently running regions
lock (m_scenes) lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene; m_scenes[scene.RegionInfo.RegionID] = scene;
} }
///<summary> ///<summary>
/// ///
///</summary> ///</summary>
@ -150,7 +151,7 @@ namespace OpenSim.Region.OptionalModules.Simian
// loaded and initialized // loaded and initialized
if (m_lastrefresh > 0 && Util.EnvironmentTickCountSubtract(m_lastrefresh) < m_refreshtime) if (m_lastrefresh > 0 && Util.EnvironmentTickCountSubtract(m_lastrefresh) < m_refreshtime)
return; return;
m_log.DebugFormat("[SIMIAN MAPTILE] map refresh fired"); m_log.DebugFormat("[SIMIAN MAPTILE] map refresh fired");
lock (m_scenes) lock (m_scenes)
{ {
@ -169,7 +170,7 @@ namespace OpenSim.Region.OptionalModules.Simian
m_lastrefresh = Util.EnvironmentTickCount(); m_lastrefresh = Util.EnvironmentTickCount();
} }
///<summary> ///<summary>
/// ///
///</summary> ///</summary>
@ -211,7 +212,7 @@ namespace OpenSim.Region.OptionalModules.Simian
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl);
request.Timeout = 20000; request.Timeout = 20000;
request.ReadWriteTimeout = 5000; request.ReadWriteTimeout = 5000;
using (HttpWebResponse response = MultipartForm.Post(request, postParameters)) using (HttpWebResponse response = MultipartForm.Post(request, postParameters))
{ {
using (Stream responseStream = response.GetResponseStream()) using (Stream responseStream = response.GetResponseStream())