diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 61 |
1 files changed, 53 insertions, 8 deletions
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 | |||
411 | private double m_rootReprioritizationDistance = 10.0; | 411 | private double m_rootReprioritizationDistance = 10.0; |
412 | private double m_childReprioritizationDistance = 20.0; | 412 | private double m_childReprioritizationDistance = 20.0; |
413 | 413 | ||
414 | private Timer m_mapGenerationTimer = new Timer(); | ||
415 | bool m_generateMaptiles = false; | ||
416 | |||
414 | #endregion | 417 | #endregion |
415 | 418 | ||
416 | #region Properties | 419 | #region Properties |
@@ -665,6 +668,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
665 | 668 | ||
666 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 669 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
667 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); | 670 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); |
671 | |||
672 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); | ||
673 | if (m_generateMaptiles) | ||
674 | { | ||
675 | int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); | ||
676 | if (maptileRefresh != 0) | ||
677 | { | ||
678 | m_mapGenerationTimer.Interval = maptileRefresh * 1000; | ||
679 | m_mapGenerationTimer.Elapsed += RegenerateMaptile; | ||
680 | m_mapGenerationTimer.AutoReset = true; | ||
681 | m_mapGenerationTimer.Start(); | ||
682 | } | ||
683 | } | ||
684 | else | ||
685 | { | ||
686 | string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); | ||
687 | UUID tileID; | ||
688 | |||
689 | if (UUID.TryParse(tile, out tileID)) | ||
690 | { | ||
691 | RegionInfo.RegionSettings.TerrainImageID = tileID; | ||
692 | } | ||
693 | } | ||
668 | } | 694 | } |
669 | catch | 695 | catch |
670 | { | 696 | { |
@@ -1694,16 +1720,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1694 | 1720 | ||
1695 | m_sceneGridService.SetScene(this); | 1721 | m_sceneGridService.SetScene(this); |
1696 | 1722 | ||
1697 | // These two 'commands' *must be* next to each other or sim rebooting fails. | 1723 | // If we generate maptiles internally at all, the maptile generator |
1698 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); | 1724 | // will register the region. If not, do it here |
1699 | 1725 | if (m_generateMaptiles) | |
1700 | GridRegion region = new GridRegion(RegionInfo); | ||
1701 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | ||
1702 | if (error != String.Empty) | ||
1703 | { | 1726 | { |
1704 | throw new Exception(error); | 1727 | RegenerateMaptile(null, null); |
1728 | } | ||
1729 | else | ||
1730 | { | ||
1731 | GridRegion region = new GridRegion(RegionInfo); | ||
1732 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | ||
1733 | if (error != String.Empty) | ||
1734 | { | ||
1735 | throw new Exception(error); | ||
1736 | } | ||
1705 | } | 1737 | } |
1706 | |||
1707 | } | 1738 | } |
1708 | 1739 | ||
1709 | #endregion | 1740 | #endregion |
@@ -4995,5 +5026,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
4995 | 5026 | ||
4996 | return offsets.ToArray(); | 5027 | return offsets.ToArray(); |
4997 | } | 5028 | } |
5029 | |||
5030 | public void RegenerateMaptile(object sender, ElapsedEventArgs e) | ||
5031 | { | ||
5032 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); | ||
5033 | if (mapModule != null) | ||
5034 | { | ||
5035 | mapModule.GenerateMaptile(); | ||
5036 | |||
5037 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); | ||
5038 | |||
5039 | if (error != String.Empty) | ||
5040 | throw new Exception(error); | ||
5041 | } | ||
5042 | } | ||
4998 | } | 5043 | } |
4999 | } | 5044 | } |