From 1458fab82c4dab9901d81419e6b515f47ea7320f Mon Sep 17 00:00:00 2001 From: Kevin Houlihan Date: Mon, 12 Sep 2011 23:08:16 +0100 Subject: Reattaching a region was failing if the estate name had not changed (issue 5035). Using the RemoteAdmin API to close then recreate a region would fail if the estate name had not changed. If the estate name /was/ changed then the existing estate would be renamed rather than a new one being created. The problem really arose from a lack of distinction in the data storage layer between creating new estates and loading existing ones. --- .../RemoteController/RemoteAdminPlugin.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 25ae3f1..e20b487 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -741,21 +741,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController } // Create a new estate with the name provided - region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true); + region.EstateSettings = m_application.EstateDataService.CreateNewEstate(); region.EstateSettings.EstateName = (string) requestData["estate_name"]; region.EstateSettings.EstateOwner = userID; // Persistence does not seem to effect the need to save a new estate region.EstateSettings.Save(); + + if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID)) + throw new Exception("Failed to join estate."); } else { int estateID = estateIDs[0]; - region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); + region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, false); - if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) - throw new Exception("Failed to join estate."); + if (region.EstateSettings.EstateID != estateID) + { + // The region is already part of an estate, but not the one we want. + region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); + + if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) + throw new Exception("Failed to join estate."); + } } // Create the region and perform any initial initialization -- cgit v1.1 From a1875ec7600758087f6c06ccaf625507362e215c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 1 Oct 2011 00:19:09 +0100 Subject: Add ability to pass in the permissions option (perm) to save oar via RemoteAdmin Applies patch in http://opensimulator.org/mantis/view.php?id=5686 Thanks Michelle Argus! --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index e20b487..08f3dc7 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -2340,10 +2340,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// UUID of the region /// region_name /// region name - /// profile + /// profile /// profile url /// noassets /// true if no assets should be saved + /// perm + /// C and/or T /// /// /// region_uuid takes precedence over @@ -2418,6 +2420,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController options["noassets"] = (string)requestData["noassets"] ; } + if (requestData.Contains("perm")) + { + options["checkPermissions"] = (string)requestData["perm"]; + } + IRegionArchiverModule archiver = scene.RequestModuleInterface(); if (archiver != null) -- cgit v1.1