aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs63
1 files changed, 54 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 18705a8..2890ecd 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -396,6 +396,9 @@ namespace OpenSim.Region.Framework.Scenes
396 private double m_rootReprioritizationDistance = 10.0; 396 private double m_rootReprioritizationDistance = 10.0;
397 private double m_childReprioritizationDistance = 20.0; 397 private double m_childReprioritizationDistance = 20.0;
398 398
399 private Timer m_mapGenerationTimer = new Timer();
400 bool m_generateMaptiles = false;
401
399 #endregion 402 #endregion
400 403
401 #region Properties 404 #region Properties
@@ -646,6 +649,29 @@ namespace OpenSim.Region.Framework.Scenes
646 } 649 }
647 650
648 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); 651 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
652
653 m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
654 if (m_generateMaptiles)
655 {
656 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
657 if (maptileRefresh != 0)
658 {
659 m_mapGenerationTimer.Interval = maptileRefresh * 1000;
660 m_mapGenerationTimer.Elapsed += RegenerateMaptile;
661 m_mapGenerationTimer.AutoReset = true;
662 m_mapGenerationTimer.Start();
663 }
664 }
665 else
666 {
667 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
668 UUID tileID;
669
670 if (UUID.TryParse(tile, out tileID))
671 {
672 RegionInfo.RegionSettings.TerrainImageID = tileID;
673 }
674 }
649 } 675 }
650 catch 676 catch
651 { 677 {
@@ -1662,16 +1688,21 @@ namespace OpenSim.Region.Framework.Scenes
1662 1688
1663 m_sceneGridService.SetScene(this); 1689 m_sceneGridService.SetScene(this);
1664 1690
1665 // These two 'commands' *must be* next to each other or sim rebooting fails. 1691 // If we generate maptiles internally at all, the maptile generator
1666 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1692 // will register the region. If not, do it here
1667 1693 if (m_generateMaptiles)
1668 GridRegion region = new GridRegion(RegionInfo);
1669 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1670 if (error != String.Empty)
1671 { 1694 {
1672 throw new Exception(error); 1695 RegenerateMaptile(null, null);
1696 }
1697 else
1698 {
1699 GridRegion region = new GridRegion(RegionInfo);
1700 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1701 if (error != String.Empty)
1702 {
1703 throw new Exception(error);
1704 }
1673 } 1705 }
1674
1675 } 1706 }
1676 1707
1677 #endregion 1708 #endregion
@@ -4878,5 +4909,19 @@ namespace OpenSim.Region.Framework.Scenes
4878 4909
4879 return offsets.ToArray(); 4910 return offsets.ToArray();
4880 } 4911 }
4912
4913 public void RegenerateMaptile(object sender, ElapsedEventArgs e)
4914 {
4915 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
4916 if (mapModule != null)
4917 {
4918 mapModule.GenerateMaptile();
4919
4920 string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
4921
4922 if (error != String.Empty)
4923 throw new Exception(error);
4924 }
4925 }
4881 } 4926 }
4882} \ No newline at end of file 4927}