aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
index ee90859..e224670 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
@@ -112,6 +112,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
112 112
113 Object[] args = new Object[] { source }; 113 Object[] args = new Object[] { source };
114 m_MapService = ServerUtils.LoadPlugin<IMapImageService>(service, args); 114 m_MapService = ServerUtils.LoadPlugin<IMapImageService>(service, args);
115 if (m_MapService == null)
116 {
117 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Unable to load LocalServiceModule from {0}. MapService module disabled. Please fix the configuration.", service);
118 return;
119 }
115 120
116 m_refreshTimer.Enabled = true; 121 m_refreshTimer.Enabled = true;
117 m_refreshTimer.AutoReset = true; 122 m_refreshTimer.AutoReset = true;
@@ -202,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
202 { 207 {
203 m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: upload maptile for {0}", scene.RegionInfo.RegionName); 208 m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: upload maptile for {0}", scene.RegionInfo.RegionName);
204 209
205 // Create a PNG map tile and upload it to the AddMapTile API 210 // Create a JPG map tile and upload it to the AddMapTile API
206 byte[] jpgData = Utils.EmptyBytes; 211 byte[] jpgData = Utils.EmptyBytes;
207 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); 212 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>();
208 if (tileGenerator == null) 213 if (tileGenerator == null)
@@ -220,13 +225,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
220 } 225 }
221 } 226 }
222 227
228 if (jpgData == Utils.EmptyBytes)
229 {
230 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Tile image generation failed");
231 return;
232 }
233
223 string reason = string.Empty; 234 string reason = string.Empty;
224 if (!m_MapService.AddMapTile((int)scene.RegionInfo.RegionLocX, (int)scene.RegionInfo.RegionLocY, jpgData, out reason)) 235 if (!m_MapService.AddMapTile((int)scene.RegionInfo.RegionLocX, (int)scene.RegionInfo.RegionLocY, jpgData, out reason))
225 { 236 {
226 m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: Unable to upload tile image for {0} at {1}-{2}: {3}", 237 m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: Unable to upload tile image for {0} at {1}-{2}: {3}",
227 scene.RegionInfo.RegionName, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, reason); 238 scene.RegionInfo.RegionName, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, reason);
228 } 239 }
229
230 } 240 }
231 } 241 }
232} \ No newline at end of file 242} \ No newline at end of file