diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 9888c3b..666e557 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -244,11 +244,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
244 | (int)Constants.RegionSize, (int)Constants.RegionSize); | 244 | (int)Constants.RegionSize, (int)Constants.RegionSize); |
245 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) | 245 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) |
246 | { | 246 | { |
247 | ConvertAndUploadMaptile(scene, subMapTile, | 247 | if(!ConvertAndUploadMaptile(scene, subMapTile, |
248 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), | 248 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), |
249 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), | 249 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), |
250 | scene.Name); | 250 | scene.Name)); |
251 | } | 251 | { |
252 | m_log.DebugFormat("{0} Upload maptileS for {1} aborted!", LogHeader, scene.Name); | ||
253 | return; // abort rest; | ||
254 | } | ||
255 | } | ||
252 | } | 256 | } |
253 | } | 257 | } |
254 | } | 258 | } |
@@ -280,7 +284,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
280 | } | 284 | } |
281 | } | 285 | } |
282 | 286 | ||
283 | private void ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) | 287 | private bool ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) |
284 | { | 288 | { |
285 | byte[] jpgData = Utils.EmptyBytes; | 289 | byte[] jpgData = Utils.EmptyBytes; |
286 | 290 | ||
@@ -289,19 +293,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
289 | tileImage.Save(stream, ImageFormat.Jpeg); | 293 | tileImage.Save(stream, ImageFormat.Jpeg); |
290 | jpgData = stream.ToArray(); | 294 | jpgData = stream.ToArray(); |
291 | } | 295 | } |
292 | if (jpgData != Utils.EmptyBytes) | 296 | |
297 | if (jpgData == Utils.EmptyBytes) | ||
293 | { | 298 | { |
294 | string reason = string.Empty; | 299 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); |
295 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) | 300 | return false; |
296 | { | ||
297 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, | ||
298 | regionName, locX, locY, reason); | ||
299 | } | ||
300 | } | 301 | } |
301 | else | 302 | |
303 | string reason = string.Empty; | ||
304 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) | ||
302 | { | 305 | { |
303 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); | 306 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, |
307 | regionName, locX, locY, reason); | ||
308 | return false; | ||
304 | } | 309 | } |
310 | return true; | ||
305 | } | 311 | } |
306 | } | 312 | } |
307 | } | 313 | } |