From 03d82a5a8524cfba07d95456d59be6f35ab72048 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 12 Feb 2011 01:08:56 +0000 Subject: [PATCH] Fix bug where "My estate" name was always used even if the user entered a different name on initial setup. Turns out we had stopped saving estate settings immediately after the name change. The scene constructor then reloade the settings and oblitereted the different name. This code could be more efficient since there's no reason for scene to reload the settings when they are already known to be valid. Thanks to Thoneve for the spot on this. --- .../LoadRegions/LoadRegionsPlugin.cs | 2 ++ OpenSim/Region/Application/OpenSimBase.cs | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 7ef0f5f455..f37c399050 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -122,9 +122,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + ")"); + m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); regionsToLoad[i].EstateSettings.Save(); + if (scene != null) { m_newRegionCreatedHandler = OnNewRegionCreated; diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 1652b82542..e950613e6b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -795,9 +795,7 @@ namespace OpenSim /// /// Load the estate information for the provided RegionInfo object. /// - /// - /// A - /// + /// public void PopulateRegionEstateInfo(RegionInfo regInfo) { IEstateDataService estateDataService = EstateDataService; @@ -819,7 +817,13 @@ namespace OpenSim regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true); regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); - //regInfo.EstateSettings.Save(); + + // FIXME: Later on, the scene constructor will reload the estate settings no matter what. + // Therefore, we need to do an initial save here otherwise the new estate name will be reset + // back to the default. The reloading of estate settings by scene could be eliminated if it + // knows that the passed in settings in RegionInfo are already valid. Also, it might be + // possible to eliminate some additional later saves made by callers of this method. + regInfo.EstateSettings.Save(); break; } else