diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 61 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 6 |
3 files changed, 59 insertions, 21 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index c08da18..4ef0b1b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -390,19 +390,6 @@ namespace OpenSim | |||
390 | // Prims have to be loaded after module configuration since some modules may be invoked during the load | 390 | // Prims have to be loaded after module configuration since some modules may be invoked during the load |
391 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 391 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
392 | 392 | ||
393 | if (scene.SnmpService != null) | ||
394 | { | ||
395 | scene.SnmpService.BootInfo("Creating region texture", scene); | ||
396 | } | ||
397 | |||
398 | // moved these here as the map texture has to be created after the modules are initialized | ||
399 | // and has to happen before the region is registered with the grid. | ||
400 | IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>(); | ||
401 | if (mapModule != null) | ||
402 | mapModule.GenerateMaptile(); | ||
403 | else | ||
404 | m_log.WarnFormat("[STARTUP]: No map module available to generate map tile"); | ||
405 | |||
406 | // TODO : Try setting resource for region xstats here on scene | 393 | // TODO : Try setting resource for region xstats here on scene |
407 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 394 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
408 | 395 | ||
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 | } |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 00a8569..cf9e217 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -225,6 +225,12 @@ | |||
225 | 225 | ||
226 | ;WorldMapModule = "WorldMap" | 226 | ;WorldMapModule = "WorldMap" |
227 | ;MapImageModule = "MapImageModule" | 227 | ;MapImageModule = "MapImageModule" |
228 | ; Set to false to not generate any maptiles | ||
229 | ;GenerateMaptiles = "true" | ||
230 | ; Refreah (in seconds) the map tile periodically | ||
231 | ;MaptileRefresh = 0 | ||
232 | ; If not generating maptiles, use this static texture asset ID | ||
233 | ;MaptileStaticUUID = "00000000-0000-0000-0000-000000000000" | ||
228 | 234 | ||
229 | ; ## | 235 | ; ## |
230 | ; ## EMAIL MODULE | 236 | ; ## EMAIL MODULE |