aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-01-23 23:44:21 +0000
committerJustin Clark-Casey (justincc)2014-01-23 23:44:21 +0000
commita859464e91f724816c2ba588a541981469d58d2b (patch)
tree50ede00a6137a29316f22229d537618bd7db2c53 /OpenSim/Region/CoreModules/World
parentStop exceptions being generated on agent connection if a telehub object has b... (diff)
downloadopensim-SC_OLD-a859464e91f724816c2ba588a541981469d58d2b.zip
opensim-SC_OLD-a859464e91f724816c2ba588a541981469d58d2b.tar.gz
opensim-SC_OLD-a859464e91f724816c2ba588a541981469d58d2b.tar.bz2
opensim-SC_OLD-a859464e91f724816c2ba588a541981469d58d2b.tar.xz
Add "generate map" console command to allow manual regeneration and storage of maptiles
Primarily for test purposes though could be useful if one prefers to manually update the map tile
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs15
2 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index 40638f8..61ba5f3 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -127,7 +127,10 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
127 try 127 try
128 { 128 {
129 using (Bitmap mapbmp = CreateMapTile()) 129 using (Bitmap mapbmp = CreateMapTile())
130 return OpenJPEG.EncodeFromImage(mapbmp, true); 130 {
131 if (mapbmp != null)
132 return OpenJPEG.EncodeFromImage(mapbmp, true);
133 }
131 } 134 }
132 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke 135 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
133 { 136 {
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index cdf1467..88761a2 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -114,6 +114,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
114 "export-map [<path>]", 114 "export-map [<path>]",
115 "Save an image of the world map", HandleExportWorldMapConsoleCommand); 115 "Save an image of the world map", HandleExportWorldMapConsoleCommand);
116 116
117 m_scene.AddCommand(
118 "Regions", this, "generate map",
119 "generate map",
120 "Generates and stores a new maptile.", HandleGenerateMapConsoleCommand);
121
117 AddHandlers(); 122 AddHandlers();
118 } 123 }
119 } 124 }
@@ -1274,6 +1279,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1274 m_scene.RegionInfo.RegionName, exportPath); 1279 m_scene.RegionInfo.RegionName, exportPath);
1275 } 1280 }
1276 1281
1282 public void HandleGenerateMapConsoleCommand(string module, string[] cmdparams)
1283 {
1284 Scene consoleScene = m_scene.ConsoleScene();
1285
1286 if (consoleScene != null && consoleScene != m_scene)
1287 return;
1288
1289 GenerateMaptile();
1290 }
1291
1277 public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) 1292 public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint)
1278 { 1293 {
1279 uint xstart = 0; 1294 uint xstart = 0;