From 85f448642b411b8fd39aee4283e9b484378336d0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Aug 2010 00:54:09 +0100 Subject: minor: Correct string format in "Can't find linkset root prim" message --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9963225..4d84018 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2165,7 +2165,7 @@ namespace OpenSim.Region.Framework.Scenes if (root == null) { - m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId); + m_log.DebugFormat("[LINK]: Can't find linkset root prim {0}", parentPrimId); return; } -- cgit v1.1 From 47838e5fb39596effd4d0f7e1021ab68e69cd9d8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 20 Aug 2010 08:46:46 +0200 Subject: Add some maptile options, change maptile generation from OpenSimBase to Scene to make it more configurable. --- OpenSim/Region/Framework/Scenes/Scene.cs | 61 +++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73472a9..98c46bd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -411,6 +411,9 @@ namespace OpenSim.Region.Framework.Scenes private double m_rootReprioritizationDistance = 10.0; private double m_childReprioritizationDistance = 20.0; + private Timer m_mapGenerationTimer = new Timer(); + bool m_generateMaptiles = false; + #endregion #region Properties @@ -665,6 +668,29 @@ namespace OpenSim.Region.Framework.Scenes m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); + + m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); + if (m_generateMaptiles) + { + int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); + if (maptileRefresh != 0) + { + m_mapGenerationTimer.Interval = maptileRefresh * 1000; + m_mapGenerationTimer.Elapsed += RegenerateMaptile; + m_mapGenerationTimer.AutoReset = true; + m_mapGenerationTimer.Start(); + } + } + else + { + string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); + UUID tileID; + + if (UUID.TryParse(tile, out tileID)) + { + RegionInfo.RegionSettings.TerrainImageID = tileID; + } + } } catch { @@ -1694,16 +1720,21 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGridService.SetScene(this); - // These two 'commands' *must be* next to each other or sim rebooting fails. - //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); - - GridRegion region = new GridRegion(RegionInfo); - string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); - if (error != String.Empty) + // If we generate maptiles internally at all, the maptile generator + // will register the region. If not, do it here + if (m_generateMaptiles) { - throw new Exception(error); + RegenerateMaptile(null, null); + } + else + { + GridRegion region = new GridRegion(RegionInfo); + string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); + if (error != String.Empty) + { + throw new Exception(error); + } } - } #endregion @@ -4995,5 +5026,19 @@ namespace OpenSim.Region.Framework.Scenes return offsets.ToArray(); } + + public void RegenerateMaptile(object sender, ElapsedEventArgs e) + { + IWorldMapModule mapModule = RequestModuleInterface(); + if (mapModule != null) + { + mapModule.GenerateMaptile(); + + string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); + + if (error != String.Empty) + throw new Exception(error); + } + } } } -- cgit v1.1