diff options
author | onefang | 2019-08-22 12:01:47 +1000 |
---|---|---|
committer | onefang | 2019-08-22 12:01:47 +1000 |
commit | fe8977564bda8ec2f328ebb2d2623c43073e9be5 (patch) | |
tree | 3bd04d2a64dcd8d141c5f4221c581fa215c2c3ad /OpenSim/Region/CoreModules/World/Warp3DMap | |
parent | OhSillyThreatLevels should throw an exception when not allowed. (diff) | |
download | opensim-SC_OLD-fe8977564bda8ec2f328ebb2d2623c43073e9be5.zip opensim-SC_OLD-fe8977564bda8ec2f328ebb2d2623c43073e9be5.tar.gz opensim-SC_OLD-fe8977564bda8ec2f328ebb2d2623c43073e9be5.tar.bz2 opensim-SC_OLD-fe8977564bda8ec2f328ebb2d2623c43073e9be5.tar.xz |
When the generate map command is given, generate the map.
The month check seems a bit dodgy, but I'll let it ride for now.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index fb94853..d094bee 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | |||
@@ -245,10 +245,20 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
245 | g.Flush(); | 245 | g.Flush(); |
246 | } | 246 | } |
247 | */ | 247 | */ |
248 | public Bitmap CreateMapTileForce() | ||
249 | { | ||
250 | m_log.Info("[MAPTILE]: Forcing a map tile regenerate."); | ||
251 | File.Delete(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")); | ||
252 | return CreateMapTile(); | ||
253 | } | ||
248 | public Bitmap CreateMapTile() | 254 | public Bitmap CreateMapTile() |
249 | { | 255 | { |
250 | if ((File.GetCreationTime(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")).Month != DateTime.Now.Month) && m_enable_refreshEveryMonth == true) | 256 | if ((File.GetCreationTime(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")).Month != DateTime.Now.Month) && (m_enable_refreshEveryMonth == true)) |
257 | { | ||
258 | m_log.InfoFormat("[MAPTILE]: Clearing old map tile out of cache {0} {1}.", | ||
259 | File.GetCreationTime(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")).Month, DateTime.Now.Month); | ||
251 | File.Delete(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")); | 260 | File.Delete(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")); |
261 | } | ||
252 | 262 | ||
253 | if(File.Exists(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp"))) | 263 | if(File.Exists(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp"))) |
254 | { | 264 | { |
@@ -256,6 +266,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
256 | } | 266 | } |
257 | else | 267 | else |
258 | { | 268 | { |
269 | m_log.Info("[MAPTILE]: Actually generating a map tile."); | ||
259 | /* this must be on all map, not just its image | 270 | /* this must be on all map, not just its image |
260 | if ((DateTime.Now - lastImageTime).TotalSeconds < 3600) | 271 | if ((DateTime.Now - lastImageTime).TotalSeconds < 3600) |
261 | { | 272 | { |