diff options
author | Justin Clark-Casey (justincc) | 2014-01-23 23:44:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-24 00:20:22 +0000 |
commit | 099975dec2a566d5b804f0c3fd43c6d17ea23d52 (patch) | |
tree | 8307d8b99a902d59053b5a703a3ca37b9945a3ab | |
parent | Stop exceptions being generated on agent connection if a telehub object has b... (diff) | |
download | opensim-SC_OLD-099975dec2a566d5b804f0c3fd43c6d17ea23d52.zip opensim-SC_OLD-099975dec2a566d5b804f0c3fd43c6d17ea23d52.tar.gz opensim-SC_OLD-099975dec2a566d5b804f0c3fd43c6d17ea23d52.tar.bz2 opensim-SC_OLD-099975dec2a566d5b804f0c3fd43c6d17ea23d52.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
-rw-r--r-- | OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 15 |
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 a26a5f0..8df9623 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 | } |
@@ -1255,6 +1260,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1255 | m_scene.RegionInfo.RegionName, exportPath); | 1260 | m_scene.RegionInfo.RegionName, exportPath); |
1256 | } | 1261 | } |
1257 | 1262 | ||
1263 | public void HandleGenerateMapConsoleCommand(string module, string[] cmdparams) | ||
1264 | { | ||
1265 | Scene consoleScene = m_scene.ConsoleScene(); | ||
1266 | |||
1267 | if (consoleScene != null && consoleScene != m_scene) | ||
1268 | return; | ||
1269 | |||
1270 | GenerateMaptile(); | ||
1271 | } | ||
1272 | |||
1258 | public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) | 1273 | public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) |
1259 | { | 1274 | { |
1260 | uint xstart = 0; | 1275 | uint xstart = 0; |