From 9588328242f4004446b5cc08251995b8d004b4f2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 2 Feb 2013 00:59:26 +0000 Subject: [PATCH] Stop exceptions being thrown if GenerateMapTiles = false but no static map tile has been set. Do more informative warn instead. --- .../MapImage/MapImageServiceModule.cs | 8 ++++++-- .../World/LegacyMap/MapImageModule.cs | 17 ++++++++++++----- bin/OpenSim.ini.example | 7 ++++--- bin/OpenSimDefaults.ini | 14 ++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index a8390865f7..26d22b8a26 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs @@ -75,7 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage public void Close() { } public void PostInitialise() { } - /// /// /// @@ -133,7 +132,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage /// public void AddRegion(Scene scene) { - if (! m_enabled) + if (!m_enabled) return; // Every shared region module has to maintain an indepedent list of @@ -206,6 +205,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage using (Image mapTile = tileGenerator.CreateMapTile()) { + // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there + // is no static map tile. + if (mapTile == null) + return; + using (MemoryStream stream = new MemoryStream()) { mapTile.Save(stream, ImageFormat.Jpeg); diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index d412efcfce..e7065dcd27 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs @@ -113,7 +113,6 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap //t = System.Environment.TickCount - t; //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); - if (drawPrimVolume) { DrawObjectVolume(m_scene, mapbmp); @@ -121,7 +120,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap } else { - mapbmp = fetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID); + mapbmp = FetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID); } return mapbmp; } @@ -232,11 +231,19 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap // } // } - private Bitmap fetchTexture(UUID id) + private Bitmap FetchTexture(UUID id) { AssetBase asset = m_scene.AssetService.Get(id.ToString()); - m_log.DebugFormat("[MAPTILE]: Fetched static texture {0}, found: {1}", id, asset != null); - if (asset == null) return null; + + if (asset != null) + { + m_log.DebugFormat("[MAPTILE]: Static map image texture {0} found for {1}", id, m_scene.Name); + } + else + { + m_log.WarnFormat("[MAPTILE]: Static map image texture {0} not found for {1}", id, m_scene.Name); + return null; + } ManagedImage managedImage; Image image; diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 0fe44e954d..653de5cc4f 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -269,9 +269,10 @@ ; DefaultScriptEngine = "XEngine" ;# {GenerateMaptiles} {} {Generate map tiles?} {true false} true - ;; Map tile options. You can choose to generate no map tiles at all, - ;; generate normal maptiles, or nominate an uploaded texture to - ;; be the map tile + ;; Map tile options. You can choose to generate normal maptiles or nominate an uploaded texture to + ;; be the map tile using the MaptileStaticUUID parameter in this section or for individual regions in + ;; the regions config file(s). If you do not want to upload map tiles at all, then you will need + ;; to disable the MapImageServiceModule entirely. ; GenerateMaptiles = true ;# {MaptileRefresh} {GenerateMaptiles} {Maptile refresh period?} {} 0 diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index c60579b834..6ebdb96a4f 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1,6 +1,20 @@ ; This file contains defaults for various settings in OpenSimulator. These can be overriden ; by changing the same setting in OpenSim.ini (once OpenSim.ini.example has been copied to OpenSim.ini). +[XMLRPC] + ;# {XmlRpcRouterModule} {} {Module used to route incoming llRemoteData calls} {XmlRpcRouterModule XmlRpcGridRouterModule} XmlRpcRouterModule + ;; If enabled and set to XmlRpcRouterModule, this will post an event, + ;; "xmlrpc_uri(string)" to the script concurrently with the first + ;; remote_data event. This will contain the fully qualified URI an + ;; external site needs to use to send XMLRPC requests to that script + ;; + ;; If enabled and set to XmlRpcGridRouterModule, newly created channels + ;; will be registered with an external service via a configured uri + XmlRpcRouterModule = "XmlRpcRouterModule" + + ;# {XmlRpcPort} {} {Port for incoming llRemoteData xmlrpc calls} {} 20800 + XmlRpcPort = 20800 + [Startup] ; Console prompt