diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 45b8d6f4b9..00657028e4 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -122,9 +122,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions Thread.CurrentThread.ManagedThreadId.ToString() + ")"); - m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); + bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); - regionsToLoad[i].EstateSettings.Save(); + if (changed) + regionsToLoad[i].EstateSettings.Save(); if (scene != null) { diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e4bd857c2f..daae3e64b4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -618,10 +618,11 @@ namespace OpenSim return; } - PopulateRegionEstateInfo(regInfo); + bool changed = PopulateRegionEstateInfo(regInfo); IScene scene; CreateRegion(regInfo, true, out scene); - regInfo.EstateSettings.Save(); + if (changed) + regInfo.EstateSettings.Save(); } /// diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index a0c9a0a489..0adb69368b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -1060,13 +1060,13 @@ namespace OpenSim /// Load the estate information for the provided RegionInfo object. /// /// - public void PopulateRegionEstateInfo(RegionInfo regInfo) + public bool PopulateRegionEstateInfo(RegionInfo regInfo) { if (EstateDataService != null) regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); if (regInfo.EstateSettings.EstateID != 0) - return; + return false; // estate info in the database did not change m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); @@ -1101,7 +1101,7 @@ namespace OpenSim } if (defaultEstateJoined) - return; + return true; // need to update the database else m_log.ErrorFormat( "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName); @@ -1163,8 +1163,10 @@ namespace OpenSim MainConsole.Instance.Output("Joining the estate failed. Please try again."); } } - } - } + } + + return true; // need to update the database + } } public class OpenSimConfigSource