aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs33
1 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b4972d6..0f84da9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
710 if (maptileRefresh != 0) 710 if (maptileRefresh != 0)
711 { 711 {
712 m_mapGenerationTimer.Interval = maptileRefresh * 1000; 712 m_mapGenerationTimer.Interval = maptileRefresh * 1000;
713 m_mapGenerationTimer.Elapsed += RegenerateMaptile; 713 m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
714 m_mapGenerationTimer.AutoReset = true; 714 m_mapGenerationTimer.AutoReset = true;
715 m_mapGenerationTimer.Start(); 715 m_mapGenerationTimer.Start();
716 } 716 }
@@ -1647,21 +1647,17 @@ namespace OpenSim.Region.Framework.Scenes
1647 { 1647 {
1648 m_sceneGridService.SetScene(this); 1648 m_sceneGridService.SetScene(this);
1649 1649
1650 //// Unfortunately this needs to be here and it can't be async.
1651 //// The map tile image is stored in RegionSettings, but it also needs to be
1652 //// stored in the GridService, because that's what the world map module uses
1653 //// to send the map image UUIDs (of other regions) to the viewer...
1654 if (m_generateMaptiles)
1655 RegenerateMaptile();
1656
1650 GridRegion region = new GridRegion(RegionInfo); 1657 GridRegion region = new GridRegion(RegionInfo);
1651 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); 1658 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1652 if (error != String.Empty) 1659 if (error != String.Empty)
1653 {
1654 throw new Exception(error); 1660 throw new Exception(error);
1655 }
1656
1657 // Generate the maptile asynchronously, because sometimes it can be very slow and we
1658 // don't want this to delay starting the region.
1659 if (m_generateMaptiles)
1660 {
1661 Util.FireAndForget(delegate {
1662 RegenerateMaptile(null, null);
1663 });
1664 }
1665 } 1661 }
1666 1662
1667 #endregion 1663 #endregion
@@ -5032,13 +5028,24 @@ namespace OpenSim.Region.Framework.Scenes
5032 /// </summary> 5028 /// </summary>
5033 /// <param name="sender"></param> 5029 /// <param name="sender"></param>
5034 /// <param name="e"></param> 5030 /// <param name="e"></param>
5035 public void RegenerateMaptile(object sender, ElapsedEventArgs e) 5031 private void RegenerateMaptile()
5036 { 5032 {
5037 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); 5033 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
5038 if (mapModule != null) 5034 if (mapModule != null)
5039 mapModule.GenerateMaptile(); 5035 mapModule.GenerateMaptile();
5040 } 5036 }
5041 5037
5038 private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e)
5039 {
5040 RegenerateMaptile();
5041
5042 // We need to propagate the new image UUID to the grid service
5043 // so that all simulators can retrieve it
5044 string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
5045 if (error != string.Empty)
5046 throw new Exception(error);
5047 }
5048
5042 // This method is called across the simulation connector to 5049 // This method is called across the simulation connector to
5043 // determine if a given agent is allowed in this region 5050 // determine if a given agent is allowed in this region
5044 // AS A ROOT AGENT. Returning false here will prevent them 5051 // AS A ROOT AGENT. Returning false here will prevent them