aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2011-06-16 17:14:41 -0700
committerDiva Canto2011-06-16 17:14:41 -0700
commit409738726d91791fbd3ea2328cea998f644f8787 (patch)
tree1b9b8540f36a35925f014dc0e915ff59e0fb247f /OpenSim/Region
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-409738726d91791fbd3ea2328cea998f644f8787.zip
opensim-SC_OLD-409738726d91791fbd3ea2328cea998f644f8787.tar.gz
opensim-SC_OLD-409738726d91791fbd3ea2328cea998f644f8787.tar.bz2
opensim-SC_OLD-409738726d91791fbd3ea2328cea998f644f8787.tar.xz
Added a couple of guards and warnings to the MapImage/MapImageServiceModule.
Diffstat (limited to 'OpenSim/Region')
-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