aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs63
-rw-r--r--bin/OpenSim.ini.example6
3 files changed, 60 insertions, 17 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index eb18e83..b80d17d 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -347,14 +347,6 @@ namespace OpenSim
347 // Prims have to be loaded after module configuration since some modules may be invoked during the load 347 // Prims have to be loaded after module configuration since some modules may be invoked during the load
348 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 348 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
349 349
350 // moved these here as the map texture has to be created after the modules are initialized
351 // and has to happen before the region is registered with the grid.
352 IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>();
353 if (mapModule != null)
354 mapModule.GenerateMaptile();
355 else
356 m_log.WarnFormat("[STARTUP]: No map module available to generate map tile");
357
358 // TODO : Try setting resource for region xstats here on scene 350 // TODO : Try setting resource for region xstats here on scene
359 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 351 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
360 352
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}
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 3dc8f23..1ac4845 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -222,6 +222,12 @@
222 222
223 ;WorldMapModule = "WorldMap" 223 ;WorldMapModule = "WorldMap"
224 ;MapImageModule = "MapImageModule" 224 ;MapImageModule = "MapImageModule"
225 ; Set to false to not generate any maptiles
226 ;GenerateMaptiles = "true"
227 ; Refreah (in seconds) the map tile periodically
228 ;MaptileRefresh = 0
229 ; If not generating maptiles, use this static texture asset ID
230 ;MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
225 231
226 ; ## 232 ; ##
227 ; ## EMAIL MODULE 233 ; ## EMAIL MODULE